Skip to content

Commit

Permalink
Add the banner partial to application layout
Browse files Browse the repository at this point in the history
This pulls in the user research banner partial defined in the govuk-web-banners gem.

This renders the banner in the same place on the page as was previously implemented.
  • Loading branch information
hannako committed Dec 10, 2024
1 parent 3a3a58b commit a2c8ef3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
<% end %>
<% end %>

<%= render "govuk_web_banners/recruitment_banner" %>

<%= yield :header %>

<main role="main" id="content" class="<%= @content_item.schema_name.dasherize %>" lang="<%= I18n.locale %>">
Expand Down
8 changes: 4 additions & 4 deletions test/integration/recruitment_banner_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class RecruitmentBannerTest < ActionDispatch::IntegrationTest
stub_content_store_has_item(content_item["base_path"], content_item.to_json)
visit content_item["base_path"]

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://survey.take-part-in-research.service.gov.uk/jfe/form/SV_2bggmg6xlelrO0S")
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://survey.take-part-in-research.service.gov.uk/jfe/form/SV_2bggmg6xlelrO0S")
end
end

Expand All @@ -47,8 +47,8 @@ class RecruitmentBannerTest < ActionDispatch::IntegrationTest
stub_content_store_has_item(content_item["base_path"], content_item.to_json)
visit content_item["base_path"]

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://survey.take-part-in-research.service.gov.uk/jfe/form/SV_2bggmg6xlelrO0S")
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://survey.take-part-in-research.service.gov.uk/jfe/form/SV_2bggmg6xlelrO0S")
end
end

Expand Down

0 comments on commit a2c8ef3

Please sign in to comment.