-
Notifications
You must be signed in to change notification settings - Fork 120
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 #6514 from alphagov/add-user-research-banner
Add user research banner for One Login
- Loading branch information
Showing
6 changed files
with
69 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
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,21 @@ | ||
module StartNode | ||
module RecruitmentBanner | ||
SURVEY_URLS = { | ||
"/childcare-costs-for-tax-credits" => "https://surveys.publishing.service.gov.uk/s/4J4QD4/", | ||
}.freeze | ||
|
||
def survey_url(path) | ||
landing_page?(path) && SURVEY_URLS[base_path] | ||
end | ||
|
||
private | ||
|
||
def base_path | ||
"/#{@flow_presenter.name}" | ||
end | ||
|
||
def landing_page?(current_path) | ||
base_path == current_path | ||
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,31 @@ | ||
require_relative "../integration_test_helper" | ||
|
||
class RecruitmentBannerTest < ActionDispatch::IntegrationTest | ||
context "user research banner" do | ||
context "childcare costs for tax credits" do | ||
setup do | ||
stub_content_store_has_item("/childcare-costs-for-tax-credits") | ||
end | ||
|
||
should "display User Research Banner on the landing page" do | ||
visit "/childcare-costs-for-tax-credits" | ||
assert page.has_css?(".gem-c-intervention") | ||
assert page.has_link?("Take part in user research (opens in a new tab)", href: "https://surveys.publishing.service.gov.uk/s/4J4QD4/") | ||
end | ||
|
||
should "not display User Research Banner on non-landing pages of the specific smart answer" do | ||
visit "/childcare-costs-for-tax-credits/y" | ||
|
||
assert_not page.has_css?(".gem-c-intervention") | ||
assert_not page.has_link?("Take part in user research (opens in a new tab)", href: "https://surveys.publishing.service.gov.uk/s/4J4QD4/") | ||
end | ||
|
||
should "not display User Research Banner unless survey URL is specified for the base path" do | ||
visit "/bridge-of-death" | ||
|
||
assert_not page.has_css?(".gem-c-intervention") | ||
assert_not page.has_link?("Take part in user research (opens in a new tab)", href: "https://surveys.publishing.service.gov.uk/s/4J4QD4/") | ||
end | ||
end | ||
end | ||
end |