diff --git a/spec/requests/check_spec.rb b/spec/requests/check_spec.rb index 9315fca9..c03d893d 100644 --- a/spec/requests/check_spec.rb +++ b/spec/requests/check_spec.rb @@ -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:) }