FIX: Show Uncategorized when unsubscribing (#13832)

If user tried to unsubscribe from a post from category Uncategorized,
the category name was not displayed. It said only "Stop watching all
topics in".
This commit is contained in:
Bianca Nenciu 2021-07-26 05:19:30 +03:00 committed by GitHub
parent ffb3e7b356
commit 6db93e86d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -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 %>

View File

@ -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!