mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +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:
@ -15,18 +15,37 @@ describe NotificationsController do
|
||||
response.should be_success
|
||||
end
|
||||
|
||||
it 'should succeed for history' do
|
||||
xhr :get, :reset_new
|
||||
response.should be_success
|
||||
end
|
||||
|
||||
it 'should mark notifications as viewed' do
|
||||
notification = Fabricate(:notification, user: user)
|
||||
user.reload.unread_notifications.should == 1
|
||||
user.reload.total_unread_notifications.should == 1
|
||||
xhr :get, :recent
|
||||
user.reload.unread_notifications.should == 0
|
||||
user.reload.total_unread_notifications.should == 1
|
||||
end
|
||||
|
||||
it 'should not mark notifications as viewed if silent param is present' do
|
||||
notification = Fabricate(:notification, user: user)
|
||||
user.reload.unread_notifications.should == 1
|
||||
user.reload.total_unread_notifications.should == 1
|
||||
xhr :get, :recent, silent: true
|
||||
user.reload.unread_notifications.should == 1
|
||||
user.reload.total_unread_notifications.should == 1
|
||||
end
|
||||
|
||||
it "updates the `read` status" do
|
||||
notification = Fabricate(:notification, user: user)
|
||||
user.reload.unread_notifications.should == 1
|
||||
user.reload.total_unread_notifications.should == 1
|
||||
xhr :put, :reset_new
|
||||
user.reload
|
||||
user.reload.unread_notifications.should == 0
|
||||
user.reload.total_unread_notifications.should == 0
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user