Skip to content

A platform for community discussion. Free, open, simple.

FIX: Show Uncategorized when unsubscribing (#13832)

Bianca Nenciu6db93e86d4eb
diff --git a/app/views/email/unsubscribe.html.erb b/app/views/email/unsubscribe.html.erb
index 2125d30233d..6351b5ef999 100644
--- a/app/views/email/unsubscribe.html.erb
+++ b/app/views/email/unsubscribe.html.erb
@@ -37,7 +37,7 @@
<p>
<label>
<%= check_box_tag 'unwatch_category' %>
- <%= t('unsubscribe.unwatch_category', category: category_badge(@topic.category)).html_safe %>
+ <%= t('unsubscribe.unwatch_category', category: category_badge(@topic.category, show_uncategorized: true)).html_safe %>
</label>
</p>
<% end %>
diff --git a/spec/requests/email_controller_spec.rb b/spec/requests/email_controller_spec.rb
index 3d79fb7aec4..4e61b3e5f56 100644
--- a/spec/requests/email_controller_spec.rb
+++ b/spec/requests/email_controller_spec.rb
@@ -273,6 +273,8 @@ RSpec.describe EmailController do
navigate_to_unsubscribe
expect(response.body).to include("unwatch_category")
+ doc = Nokogiri::HTML5::fragment(response.body)
+ expect(doc.css('a.badge-wrapper[href="/c/uncategorized/1"]').size).to eq(1)
cu.destroy!