mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 04:31:10 +08:00
FEATURE: Mark All as Read button for Notifications page
Added a Mark All as Read button to the top/bottom of the notifications user page https://meta.discourse.org/t/possibility-to-selectively-or-completely-mark-notifications-as-read/20227 Remove notifications property (no longer used)
This commit is contained in:
@ -78,6 +78,10 @@ describe Notification do
|
||||
lambda { Fabricate(:notification, user: user); user.reload }.should change(user, :unread_notifications)
|
||||
end
|
||||
|
||||
it 'increases total_unread_notifications' do
|
||||
lambda { Fabricate(:notification, user: user); user.reload }.should change(user, :total_unread_notifications)
|
||||
end
|
||||
|
||||
it "doesn't increase unread_private_messages" do
|
||||
lambda { Fabricate(:notification, user: user); user.reload }.should_not change(user, :unread_private_messages)
|
||||
end
|
||||
@ -88,6 +92,10 @@ describe Notification do
|
||||
lambda { Fabricate(:private_message_notification, user: user); user.reload }.should_not change(user, :unread_notifications)
|
||||
end
|
||||
|
||||
it 'increases total_unread_notifications' do
|
||||
lambda { Fabricate(:notification, user: user); user.reload }.should change(user, :total_unread_notifications)
|
||||
end
|
||||
|
||||
it "increases unread_private_messages" do
|
||||
lambda { Fabricate(:private_message_notification, user: user); user.reload }.should change(user, :unread_private_messages)
|
||||
end
|
||||
@ -141,6 +149,7 @@ describe Notification do
|
||||
it 'should create and rollup private message notifications' do
|
||||
@target.notifications.first.notification_type.should == Notification.types[:private_message]
|
||||
@post.user.unread_notifications.should == 0
|
||||
@post.user.total_unread_notifications.should == 0
|
||||
@target.unread_private_messages.should == 1
|
||||
|
||||
Fabricate(:post, topic: @topic, user: @topic.user)
|
||||
@ -197,6 +206,7 @@ describe Notification do
|
||||
user.reload
|
||||
|
||||
user.unread_notifications.should == 0
|
||||
user.total_unread_notifications.should == 2
|
||||
user.unread_private_messages.should == 1
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user