-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for authority without feedback email
- Loading branch information
Showing
1 changed file
with
23 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 |
---|---|---|
|
@@ -17,6 +17,29 @@ | |
expect(page).to have_content("To comment on this application you will need to go to the original source") | ||
end | ||
|
||
describe "an authority without a feedback email in the new design" do | ||
before do | ||
authority = create(:authority, full_name: "Byron Shire Council") | ||
application = create(:geocoded_application, id: "1", authority:, date_scraped: Date.new(2023, 1, 1)) | ||
# Note that we're ensuring that the application has a static first_date_scraped and we freeze the current | ||
# time so that the page should always have the same text on it | ||
Timecop.freeze(Date.new(2023, 6, 1)) do | ||
sign_in create(:confirmed_user, tailwind_theme: true, name: "Jane Ng") | ||
visit(application_path(application)) | ||
end | ||
end | ||
|
||
it "lets the user know what to do instead" do | ||
expect(page).to have_content("To comment on this application you will need to go to the original source") | ||
end | ||
|
||
# rubocop:disable RSpec/NoExpectationExample | ||
it "renders a snapshot for a visual diff", js: true do | ||
page.percy_snapshot("Application authority without feedback email") | ||
end | ||
# rubocop:enable RSpec/NoExpectationExample | ||
end | ||
|
||
it "Getting an error message if the comment form isn’t completed correctly" do | ||
authority = create(:authority, full_name: "Foo", email: "[email protected]") | ||
application = create(:geocoded_application, id: "1", authority:) | ||
|