-
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.
- Loading branch information
1 parent
b5053ba
commit 4e92c69
Showing
6 changed files
with
67 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.gem-c-intervention { | ||
margin-top: govuk-spacing(4); | ||
} |
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,19 @@ | ||
module ContentItem | ||
module RecruitmentBanner | ||
BRAND_SURVEY_URL = "https://surveys.publishing.service.gov.uk/s/5G06FO/".freeze | ||
SURVEY_URL_MAPPINGS = { | ||
"/repaying-your-student-loan" => BRAND_SURVEY_URL, | ||
"/student-finance" => BRAND_SURVEY_URL, | ||
"/jobseekers-allowance" => BRAND_SURVEY_URL, | ||
}.freeze | ||
|
||
def recruitment_survey_url | ||
brand_user_research_test_url | ||
end | ||
|
||
def brand_user_research_test_url | ||
key = content_item["base_path"] | ||
SURVEY_URL_MAPPINGS[key] | ||
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
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,33 @@ | ||
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 = | ||
[ | ||
"/repaying-your-student-loan", | ||
"/student-finance", | ||
"/jobseekers-allowance", | ||
] | ||
|
||
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://surveys.publishing.service.gov.uk/s/5G06FO/") | ||
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://surveys.publishing.service.gov.uk/s/5G06FO/") | ||
end | ||
end |