Skip to content

Commit 780aa39

Browse files
committed
Add user research banner
As requested by MOD via our normal processes https://trello.com/c/2RgPDQf8/2800-govuk-user-research-banner-requests-mod
1 parent 4d85538 commit 780aa39

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed

app/views/content_items/detailed_guide.html.erb

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
schema: :faq
44
) %>
55
<% end %>
6+
<%= render 'shared/intervention_banner' %>
67

78
<%= render 'shared/email_subscribe_unsubscribe_flash', { title: @content_item.title_and_context[:title] } %>
89

lib/data/recruitment_banners.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@
44
# suggestion_text: "Help improve GOV.UK"
55
# suggestion_link_text: "Sign up to take part in user research (opens in a new tab)"
66
# survey_url: https://google.com
7-
# page_paths:
7+
# page_paths:
88
# - /
99
# - /foreign-travel-advice
1010

1111
banners:
12+
- name: MOD banner 20/08/2024
13+
suggestion_text: "Help improve GOV.UK"
14+
suggestion_link_text: "Take part in user research (opens in a new tab)"
15+
survey_url: https://submit.forms.service.gov.uk/form/3874/give-feedback-on-medals-information-on-gov-uk/13188
16+
page_paths:
17+
- /guidance/medals-campaigns-descriptions-and-eligibility
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
require "test_helper"
2+
3+
class RecruitmentBannerTest < ActionDispatch::IntegrationTest
4+
test "MOD banner 20/08/2024 is displayed on page of interest" do
5+
detailed_guide = GovukSchemas::Example.find("detailed_guide", example_name: "detailed_guide")
6+
path = "/guidance/medals-campaigns-descriptions-and-eligibility"
7+
8+
detailed_guide["base_path"] = path
9+
stub_content_store_has_item(detailed_guide["base_path"], detailed_guide.to_json)
10+
visit detailed_guide["base_path"]
11+
12+
assert page.has_css?(".gem-c-intervention")
13+
assert 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")
14+
end
15+
16+
test "MOD banner 20/08/2024 is not displayed on all pages" do
17+
detailed_guide = GovukSchemas::Example.find("detailed_guide", example_name: "detailed_guide")
18+
detailed_guide["base_path"] = "/nothing-to-see-here"
19+
stub_content_store_has_item(detailed_guide["base_path"], detailed_guide.to_json)
20+
visit detailed_guide["base_path"]
21+
22+
assert_not page.has_css?(".gem-c-intervention")
23+
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")
24+
end
25+
end

0 commit comments

Comments
 (0)