Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove research banner #6592

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions app/presenters/start_node/recruitment_banner.rb
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
module StartNode
module RecruitmentBanner
SURVERY_URL = "https://surveys.publishing.service.gov.uk/s/SNFVW1/".freeze
SURVEY_URLS = {
"/maternity-paternity-calculator" => SURVERY_URL,
"/calculate-statutory-sick-pay" => SURVERY_URL,
}.freeze

BENEFITS_SURVEY_URL = "https://signup.take-part-in-research.service.gov.uk/home?utm_campaign=Content_History&utm_source=Hold_gov_to_account&utm_medium=gov.uk&t=GDS&id=16".freeze
BENEFITS_SURVEY_URLS = {
"/state-pension-age" => BENEFITS_SURVEY_URL,
"/check-benefits-financial-support" => BENEFITS_SURVEY_URL,
"/child-benefit-tax-calculator" => BENEFITS_SURVEY_URL,
}.freeze

def survey_url(path)
landing_page?(path) && SURVEY_URLS[base_path]
end

def benefits_survey_url(path)
landing_page?(path) && BENEFITS_SURVEY_URLS[base_path]
end
Expand Down
11 changes: 1 addition & 10 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
<% content_for :body do %>
<div class="smart_answer">
<%= yield :breadcrumbs %>
<% if @presenter && @presenter.start_node.survey_url(request.path) %>
<div class="banner-container govuk-!-static-margin-top-4">
<%= render "govuk_publishing_components/components/intervention", {
suggestion_text: "Help improve a new GOV.UK tool",
suggestion_link_text: "Sign up to take part in user research",
suggestion_link_url: @presenter.start_node.survey_url(request.path),
new_tab: true,
} %>
</div>
<% elsif @presenter && @presenter.start_node.benefits_survey_url(request.path) %>
<% if @presenter && @presenter.start_node.benefits_survey_url(request.path) %>
<div class="banner-container govuk-!-static-margin-top-4">
<%= render "govuk_publishing_components/components/intervention", {
suggestion_text: "Help improve GOV.UK",
Expand Down
26 changes: 0 additions & 26 deletions test/integration/recruitment_banner_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,6 @@

class RecruitmentBannerTest < ActionDispatch::IntegrationTest
context "user research banner" do
context "maternity paternity calculator" do
setup do
stub_content_store_has_item("/maternity-paternity-calculator")
end

should "display User Research Banner on the landing page" do
visit "/maternity-paternity-calculator"
assert page.has_css?(".gem-c-intervention")
assert page.has_link?("Sign up to take part in user research (opens in a new tab)", href: "https://surveys.publishing.service.gov.uk/s/SNFVW1/")
end

should "not display User Research Banner on non-landing pages of the specific smart answer" do
visit "/maternity-paternity-calculator/y"

assert_not page.has_css?(".gem-c-intervention")
assert_not page.has_link?("Sign up to take part in user research (opens in a new tab)", href: "https://surveys.publishing.service.gov.uk/s/SNFVW1/")
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?("Sign up to take part in user research (opens in a new tab)", href: "https://surveys.publishing.service.gov.uk/s/SNFVW1/")
end
end

context "check state pension age" do
setup do
stub_content_store_has_item("/state-pension-age")
Expand Down