diff --git a/app/views/users/_dmail_notice.html.erb b/app/views/users/_dmail_notice.html.erb index 2c73500ab..2eaf03ce4 100644 --- a/app/views/users/_dmail_notice.html.erb +++ b/app/views/users/_dmail_notice.html.erb @@ -1,4 +1,4 @@ -
+

You have <%= link_to "unread mail", dmails_path(search: { folder: "received" }) %>.

<%= link_to "Close this", "#", id: "hide-dmail-notice" %>
diff --git a/test/functional/dmails_controller_test.rb b/test/functional/dmails_controller_test.rb index 6e39189b4..607b8aa46 100644 --- a/test/functional/dmails_controller_test.rb +++ b/test/functional/dmails_controller_test.rb @@ -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