Skip to content

Commit 0a73e6b

Browse files
committed
Add HMRC's UR banner to required pages
1 parent a1a81c2 commit 0a73e6b

File tree

5 files changed

+96
-2
lines changed

5 files changed

+96
-2
lines changed

app/views/content_items/answer.html.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55

66
<%= @requested_variant.analytics_meta_tag.html_safe if @requested_variant.present? %>
77
<% end %>
8-
8+
<%= render 'shared/intervention_banner' %>
99
<%= render 'content_items/body_with_related_links' %>

app/views/content_items/document_collection.html.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
schema: :article
44
) %>
55
<% end %>
6-
6+
<%= render 'shared/intervention_banner' %>
77
<div class="govuk-grid-row">
88
<div class="govuk-grid-column-two-thirds">
99
<%= render 'govuk_publishing_components/components/title',

app/views/content_items/guide.html.erb

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
<% content_for :simple_header, true %>
1919

20+
<%= render 'shared/intervention_banner' %>
21+
2022
<div class="govuk-grid-row">
2123
<div class="govuk-grid-column-two-thirds">
2224
<%= render 'govuk_publishing_components/components/title', { title: @content_item.content_title } %>

lib/data/recruitment_banners.yml

+14
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,17 @@ banners:
1515
survey_url: https://submit.forms.service.gov.uk/form/3874/give-feedback-on-medals-information-on-gov-uk/13188
1616
page_paths:
1717
- /guidance/medals-campaigns-descriptions-and-eligibility
18+
- name: HMRC banner 29/08/2024
19+
suggestion_text: "Help improve GOV.UK"
20+
suggestion_link_text: "Sign up to take part in user research (opens in a new tab)"
21+
survey_url: https://survey.take-part-in-research.service.gov.uk/jfe/form/SV_74GjifgnGv6GsMC?Source=BannerList_HMRC_CCG_Compliance
22+
page_paths:
23+
- /government/collections/tax-compliance-detailed-information
24+
- /government/collections/hm-revenue-and-customs-compliance-checks-factsheets
25+
- /difficulties-paying-hmrc
26+
- /tax-help
27+
- /get-help-hmrc-extra-support
28+
- /guidance/voluntary-and-community-sector-organisations-who-can-give-you-extra-support
29+
- /tax-appeals
30+
- /guidance/how-to-get-a-review-of-an-hmrc-decision
31+
- /guidance/tax-disputes-alternative-dispute-resolution-adr

test/integration/recruitment_banner_test.rb

+78
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
require "test_helper"
22

33
class RecruitmentBannerTest < ActionDispatch::IntegrationTest
4+
def hmrc_banner_survey_url
5+
"https://survey.take-part-in-research.service.gov.uk/jfe/form/SV_74GjifgnGv6GsMC?Source=BannerList_HMRC_CCG_Compliance"
6+
end
7+
48
test "MOD banner 20/08/2024 is displayed on page of interest" do
59
detailed_guide = GovukSchemas::Example.find("detailed_guide", example_name: "detailed_guide")
610
path = "/guidance/medals-campaigns-descriptions-and-eligibility"
@@ -22,4 +26,78 @@ class RecruitmentBannerTest < ActionDispatch::IntegrationTest
2226
assert_not page.has_css?(".gem-c-intervention")
2327
assert_not page.has_link?("Take part in user research", href: "https://submit.forms.service.gov.uk/form/3874/give-feedback-on-medals-information-on-gov-uk/13188")
2428
end
29+
30+
test "HMRC banner 29/08/2024 is displayed on detailed guides of interest" do
31+
detailed_guide = GovukSchemas::Example.find("detailed_guide", example_name: "detailed_guide")
32+
detailed_guide_paths = [
33+
"/guidance/voluntary-and-community-sector-organisations-who-can-give-you-extra-support",
34+
"/guidance/how-to-get-a-review-of-an-hmrc-decision",
35+
"/guidance/tax-disputes-alternative-dispute-resolution-adr",
36+
]
37+
38+
detailed_guide_paths.each do |path|
39+
detailed_guide["base_path"] = path
40+
stub_content_store_has_item(detailed_guide["base_path"], detailed_guide.to_json)
41+
visit detailed_guide["base_path"]
42+
43+
assert page.has_css?(".gem-c-intervention")
44+
assert page.has_link?("Sign up to take part in user research (opens in a new tab)", href: hmrc_banner_survey_url)
45+
end
46+
end
47+
48+
test "HMRC banner 29/08/2024 is displayed on document collections of interest" do
49+
document_collection = GovukSchemas::Example.find("document_collection", example_name: "document_collection")
50+
document_collection_paths = [
51+
"/government/collections/tax-compliance-detailed-information",
52+
"/government/collections/hm-revenue-and-customs-compliance-checks-factsheets",
53+
]
54+
55+
document_collection_paths.each do |path|
56+
document_collection["base_path"] = path
57+
stub_content_store_has_item(document_collection["base_path"], document_collection.to_json)
58+
visit document_collection["base_path"]
59+
60+
assert page.has_css?(".gem-c-intervention")
61+
assert page.has_link?("Sign up to take part in user research (opens in a new tab)", href: hmrc_banner_survey_url)
62+
end
63+
end
64+
65+
test "HMRC banner 29/08/2024 is displayed on guides of interest" do
66+
guide = GovukSchemas::Example.find("guide", example_name: "guide")
67+
guide_paths = [
68+
"/difficulties-paying-hmrc",
69+
"/tax-help",
70+
"/get-help-hmrc-extra-support",
71+
"/tax-appeals",
72+
]
73+
74+
guide_paths.each do |path|
75+
guide["base_path"] = path
76+
stub_content_store_has_item(guide["base_path"], guide.to_json)
77+
visit guide["base_path"]
78+
79+
assert page.has_css?(".gem-c-intervention")
80+
assert page.has_link?("Sign up to take part in user research (opens in a new tab)", href: hmrc_banner_survey_url)
81+
end
82+
end
83+
84+
test "HMRC banner 29/08/2024 is displayed on answer pages of interest" do
85+
answer = GovukSchemas::Example.find("answer", example_name: "answer")
86+
87+
answer["base_path"] = "/tax-help"
88+
stub_content_store_has_item(answer["base_path"], answer.to_json)
89+
visit answer["base_path"]
90+
91+
assert page.has_css?(".gem-c-intervention")
92+
assert page.has_link?("Sign up to take part in user research (opens in a new tab)", href: hmrc_banner_survey_url)
93+
end
94+
95+
test "HMRC banner 29/08/2024 is not displayed on all pages" do
96+
detailed_guide = GovukSchemas::Example.find("detailed_guide", example_name: "detailed_guide")
97+
detailed_guide["base_path"] = "/nothing-to-see-here"
98+
stub_content_store_has_item(detailed_guide["base_path"], detailed_guide.to_json)
99+
visit detailed_guide["base_path"]
100+
101+
assert_not page.has_css?(".gem-c-intervention")
102+
end
25103
end

0 commit comments

Comments
 (0)