Skip to content

Commit

Permalink
Add test for danger response
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanHallam committed Mar 6, 2025
1 parent c2ecc9a commit f255756
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions spec/requests/check_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,24 @@ def check_link_path(query_params = {})
include_examples "returns link report"
end

context "when a checked uri, that is of status danger, is requested" do
let(:danger) { ["Has a dangerous link"] }
let(:link_report) { build_link_report(uri:, status: "danger", danger:) }

before do
create(
:check,
link: create(:link, uri:),
link_danger: danger,
completed_at: 1.minute.ago,
)

get check_link_path(uri:)
end

include_examples "returns link report"
end

context "when a checked uri, that is of status broken, is requested" do
let(:errors) { ["Has a cyclic redirect."] }
let(:link_report) { build_link_report(uri:, status: "broken", errors:) }
Expand Down

0 comments on commit f255756

Please sign in to comment.