From 2a845285a03154969cb913820cd77f80375ba675 Mon Sep 17 00:00:00 2001 From: Jessica Jones Date: Tue, 12 Nov 2024 13:15:29 +0000 Subject: [PATCH] Add flash success banner to document collection pages This was missing from https://github.com/alphagov/government-frontend/pull/2535 --- app/views/content_items/document_collection.html.erb | 3 +++ test/controllers/content_items_controller_test.rb | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/views/content_items/document_collection.html.erb b/app/views/content_items/document_collection.html.erb index 97f92a238..3fa950e6f 100644 --- a/app/views/content_items/document_collection.html.erb +++ b/app/views/content_items/document_collection.html.erb @@ -3,6 +3,9 @@ schema: :article ) %> <% end %> + +<%= render 'shared/email_subscribe_unsubscribe_flash', { title: @content_item.title_and_context[:title] } %> + <%= render 'shared/intervention_banner' %>
diff --git a/test/controllers/content_items_controller_test.rb b/test/controllers/content_items_controller_test.rb index 8cd57808a..5ad576330 100644 --- a/test/controllers/content_items_controller_test.rb +++ b/test/controllers/content_items_controller_test.rb @@ -310,7 +310,7 @@ class ContentItemsControllerTest < ActionController::TestCase assert response.headers["Vary"].include?("GOVUK-Account-Session-Flash") end - %w[publication consultation detailed_guide call_for_evidence].each do |schema_name| + %w[publication consultation detailed_guide call_for_evidence document_collection].each do |schema_name| test "#{schema_name} displays the subscription success banner when the 'email-subscription-success' flash is present" do example_name = %w[consultation call_for_evidence].include?(schema_name) ? "open_#{schema_name}" : schema_name content_item = content_store_has_schema_example(schema_name, example_name)