Skip to content

Commit

Permalink
Add UKVI UR banner to required pages
Browse files Browse the repository at this point in the history
  • Loading branch information
catalinailie committed Nov 11, 2024
1 parent d6310b4 commit 7ef4c8d
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/views/browse/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
} %>
<% end %>

<%= render 'shared/intervention_banner' %>

<% if display_popular_links_for_slug?(page.slug) %>
<div class="govuk-width-container">
<div class="browse__action-links">
Expand Down
1 change: 1 addition & 0 deletions app/views/organisations/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<%= render partial: 'meta', locals: { organisation: @organisation } %>
<%= render partial: 'breadcrumb' %>
<%= render 'shared/intervention_banner' %>
<%= render partial: 'header' %>
<% if @organisation.custom_banner %>
<%= render "govuk_publishing_components/components/notice", {
Expand Down
7 changes: 7 additions & 0 deletions lib/data/recruitment_banners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,10 @@
# - /foreign-travel-advice

banners:
- name: UKVI banner 11/11/24
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:
- /browse/visas-immigration
- /government/organisations/uk-visas-and-immigration
43 changes: 43 additions & 0 deletions spec/features/recruitment_banner_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
require "integration_spec_helper"

RSpec.feature "Research panel banner" do
include SearchApiHelpers
include OrganisationHelpers
include RecruitmentBannerHelper

scenario "browse pages where we want to display UKVI banner" do
base_path = "/browse/visas-immigration"
schema = GovukSchemas::Example.find("mainstream_browse_page", example_name: "level_2_page")
schema["base_path"] = base_path
stub_content_store_has_item(schema["base_path"], schema)
search_api_has_documents_for_browse_page(schema["content_id"], [base_path], page_size: SearchApiSearch::PAGE_SIZE_TO_GET_EVERYTHING)

visit schema["base_path"]

expect(page.status_code).to eq(200)
expect(page).to have_selector(".gem-c-intervention")
end

scenario "organisation pages where we want to display UKVI banner" do
base_path = "/government/organisations/uk-visas-and-immigration"
schema = GovukSchemas::Example.find("organisation", example_name: "tribunal")
schema["base_path"] = base_path
stub_content_and_search(schema)

visit schema["base_path"]

expect(page.status_code).to eq(200)
expect(page).to have_selector(".gem-c-intervention")
end

scenario "pages where we don't want to display UKVI banner" do
schema = GovukSchemas::Example.find("mainstream_browse_page", example_name: "level_2_page")
stub_content_store_has_item(schema["base_path"], schema)
search_api_has_documents_for_browse_page(schema["content_id"], [schema["base_path"]], page_size: SearchApiSearch::PAGE_SIZE_TO_GET_EVERYTHING)

visit schema["base_path"]

expect(page.status_code).to eq(200)
expect(page).to_not have_selector(".gem-c-intervention")
end
end

0 comments on commit 7ef4c8d

Please sign in to comment.