Skip to content
Permalink
Browse files

Fix #4287: Hide Dmail notice persistently shown even after closing

  • Loading branch information
evazion committed Feb 6, 2020
1 parent 960ed89 commit 094b9e6d07c91f86696a6a830f70a20e9be976a7
Showing with 10 additions and 1 deletion.
  1. +1 −1 app/views/users/_dmail_notice.html.erb
  2. +9 −0 test/functional/dmails_controller_test.rb
@@ -1,4 +1,4 @@
<div class="notice notice-info notice-large" id="dmail-notice" data-id="<%= latest_unread_dmail(CurrentUser.user) %>">
<div class="notice notice-info notice-large" id="dmail-notice" data-id="<%= latest_unread_dmail(CurrentUser.user).id %>">
<h2>You have <%= link_to "unread mail", dmails_path(search: { folder: "received" }) %>.</h2>
<div><%= link_to "Close this", "#", id: "hide-dmail-notice" %></div>
</div>
@@ -194,6 +194,15 @@ class DmailsControllerTest < ActionDispatch::IntegrationTest
assert_select "#dmail-notice", 1
assert_select "#nav-my-account-link", text: "My Account (1)"
end

should "not show the unread dmail notice after closing it" do
cookies[:hide_dmail_notice] = @user.dmails.active.unread.first.id
get_auth posts_path, @user

assert_response :success
assert_select "#dmail-notice", 0
assert_select "#nav-my-account-link", text: "My Account (1)"
end
end
end
end

0 comments on commit 094b9e6

Please sign in to comment.
You can’t perform that action at this time.