Skip to content

Commit

Permalink
Add request and system tests for fatality_notice
Browse files Browse the repository at this point in the history
  • Loading branch information
KludgeKML committed Feb 12, 2025
1 parent 0008b0b commit 1391d9a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
13 changes: 13 additions & 0 deletions spec/requests/fatality_notice_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
RSpec.describe "Fatality Notice" do
before do
content_store_has_example_item("/government/fatalities/sad-news", schema: :fatality_notice)
end

describe "GET show" do
it "returns 200" do
get "/government/fatalities/sad-news"

expect(response).to have_http_status(:ok)
end
end
end
18 changes: 18 additions & 0 deletions spec/system/fatality_notice_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
RSpec.describe "Fatality Notice" do
before do
content_store_has_example_item("/government/fatalities/sad-news", schema: :fatality_notice)
end

it_behaves_like "it has meta tags", "fatality_notice", "fatality_notice"

context "when visiting a fatality notice" do
it "displays the fatality notice page" do
visit "/government/fatalities/sad-news"

expect(page).to have_title("Sir George Pomeroy Colley killed in Boer War - GOV.UK")

expect(page).to have_css("h1", text: "Sir George Pomeroy Colley killed in Boer War")
expect(page).to have_text("It is with great sadness that the Ministry of Defence must confirm that Sir George Pomeroy Colley, died in battle in Zululand on 27 February 1881")
end
end
end

0 comments on commit 1391d9a

Please sign in to comment.