-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add request and system tests for fatality_notice
- Loading branch information
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |