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

Add user research banner #3304

Merged
merged 1 commit into from
Aug 22, 2024
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
1 change: 1 addition & 0 deletions app/views/content_items/detailed_guide.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
schema: :faq
) %>
<% end %>
<%= render 'shared/intervention_banner' %>
hannako marked this conversation as resolved.
Show resolved Hide resolved

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

Expand Down
8 changes: 7 additions & 1 deletion lib/data/recruitment_banners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@
# suggestion_text: "Help improve GOV.UK"
# suggestion_link_text: "Sign up to take part in user research (opens in a new tab)"
# survey_url: https://google.com
# page_paths:
# page_paths:
# - /
# - /foreign-travel-advice

banners:
- name: MOD banner 20/08/2024
suggestion_text: "Help improve GOV.UK"
suggestion_link_text: "Take part in user research (opens in a new tab)"
survey_url: https://submit.forms.service.gov.uk/form/3874/give-feedback-on-medals-information-on-gov-uk/13188
page_paths:
- /guidance/medals-campaigns-descriptions-and-eligibility
25 changes: 25 additions & 0 deletions test/integration/recruitment_banner_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
require "test_helper"

class RecruitmentBannerTest < ActionDispatch::IntegrationTest
test "MOD banner 20/08/2024 is displayed on page of interest" do
detailed_guide = GovukSchemas::Example.find("detailed_guide", example_name: "detailed_guide")
path = "/guidance/medals-campaigns-descriptions-and-eligibility"

detailed_guide["base_path"] = path
stub_content_store_has_item(detailed_guide["base_path"], detailed_guide.to_json)
visit detailed_guide["base_path"]

assert page.has_css?(".gem-c-intervention")
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")
end

test "MOD banner 20/08/2024 is not displayed on all pages" do
detailed_guide = GovukSchemas::Example.find("detailed_guide", example_name: "detailed_guide")
detailed_guide["base_path"] = "/nothing-to-see-here"
stub_content_store_has_item(detailed_guide["base_path"], detailed_guide.to_json)
visit detailed_guide["base_path"]

assert_not page.has_css?(".gem-c-intervention")
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")
end
end
Loading