-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3129 from alphagov/set-up-user-research-banner
Set up DWP user research banner
- Loading branch information
Showing
4 changed files
with
46 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
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
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
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,34 @@ | ||
require "test_helper" | ||
|
||
class RecruitmentBannerTest < ActionDispatch::IntegrationTest | ||
test "Brand user research banner is displayed on pages of interest" do | ||
guide = GovukSchemas::Example.find("guide", example_name: "guide") | ||
|
||
pages_of_interest = | ||
[ | ||
"/maternity-allowance", | ||
"/funeral-payments", | ||
"/disability-living-allowance-children", | ||
"/pension-credit", | ||
] | ||
|
||
pages_of_interest.each do |path| | ||
guide["base_path"] = path | ||
stub_content_store_has_item(guide["base_path"], guide.to_json) | ||
visit guide["base_path"] | ||
|
||
assert page.has_css?(".gem-c-intervention") | ||
assert page.has_link?("Take part in user research", href: "https://forms.office.com/e/CkfCRwdLQj") | ||
end | ||
end | ||
|
||
test "Brand user research banner is not displayed on all pages" do | ||
guide = GovukSchemas::Example.find("guide", example_name: "guide") | ||
guide["base_path"] = "/nothing-to-see-here" | ||
stub_content_store_has_item(guide["base_path"], guide.to_json) | ||
visit guide["base_path"] | ||
|
||
assert_not page.has_css?(".gem-c-intervention") | ||
assert_not page.has_link?("Take part in user research", href: "https://forms.office.com/e/CkfCRwdLQj") | ||
end | ||
end |