Skip to content

Commit

Permalink
Improve web availability bot notification message (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
FelipeGuzmanSierra authored Sep 6, 2024
1 parent 37f49b7 commit 2817a1d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
4 changes: 1 addition & 3 deletions lib/bas/bot/fetch_billing_from_digital_ocean.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ def params
end

def last_billing
return read_response.data["billing"] unless read_response.data.nil?

{ month_to_date_balance: 0 }
read_response.data.nil? ? nil : read_response.data["billing"]
end
end
end
7 changes: 1 addition & 6 deletions lib/bas/bot/review_domain_availability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,7 @@ def availability
end

def notification(response)
data = {
domain: read_response.data["url"],
status_code: response.code
}

":warning: Domain is down: #{data}"
":warning: The Domain #{read_response.data["url"]} is down with an error code of #{response.code}"
end
end
end
2 changes: 1 addition & 1 deletion spec/bas/bot/fetch_billing_from_digital_ocean_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@

processed = @bot.process

expect(processed).to eq({ success: { billing: do_bill, last_billing: { month_to_date_balance: 0 } } })
expect(processed).to eq({ success: { billing: do_bill, last_billing: nil } })
end

it "returns a success hash with the digital ocean bill when a last billing was not found" do
Expand Down

0 comments on commit 2817a1d

Please sign in to comment.