Skip to content

Commit 32c790a

Browse files
committed
Fix email-subscription-already-subscribed flash inconsistency
In email-alert-frontend we set this flash message in the AccountSubscriptionsController[1][2], but the name of the key used in this app was inconsistent with what was being set - so the banner was never being shown. [1] https://github.com/alphagov/email-alert-frontend/blob/22a0a2048dc09243a386a214bb507c52f51bc8f1/app/controllers/account_subscriptions_controller.rb#L86 [2] https://github.com/alphagov/email-alert-frontend/blob/22a0a2048dc09243a386a214bb507c52f51bc8f1/app/services/create_account_subscription_service.rb#L5
1 parent 2657c73 commit 32c790a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/views/shared/_email_subscribe_unsubscribe_flash.html.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
} %>
1919
</div>
2020
</div>
21-
<% elsif @account_flash.include?("email-subscribe-already-subscribed") %>
21+
<% elsif @account_flash.include?("email-subscription-already-subscribed") %>
2222
<div class="govuk-grid-row">
2323
<div class="govuk-grid-column-two-thirds govuk-!-margin-top-3">
2424
<%= render "govuk_publishing_components/components/success_alert", {

test/controllers/content_items_controller_test.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ class ContentItemsControllerTest < ActionController::TestCase
392392
test "displays the already subscribed success banner when the 'email-subscribe-already-subscribed' flash is present" do
393393
content_item = content_store_has_schema_example("publication", "publication")
394394

395-
request.headers["GOVUK-Account-Session"] = GovukPersonalisation::Flash.encode_session("session-id", %w[email-subscribe-already-subscribed])
395+
request.headers["GOVUK-Account-Session"] = GovukPersonalisation::Flash.encode_session("session-id", %w[email-subscription-already-subscribed])
396396
get :show, params: { path: path_for(content_item) }
397397
assert response.body.include?("already getting emails about this page")
398398
end

0 commit comments

Comments
 (0)