mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 20:32:44 +08:00
FIX: Always ensure notifications are treated as read once clicked
UX: improve messaging so notifications list is far more stable PERF: improve performance of notifcation lookup queries - Add feature "SetTransientHeader" that allows shipping info to server in the next Ajax request - remove local storage hack used for notifications - amend lookupStale to return hydrated objects, move logic into store - stop magically clearing various notifications (likes, invitee accepted, group_summary, granted badge)
This commit is contained in:
@ -85,6 +85,35 @@ describe TopicsController do
|
||||
|
||||
end
|
||||
|
||||
describe 'clear_notifications' do
|
||||
it 'correctly clears notifications if specified via cookie' do
|
||||
notification = Fabricate(:notification)
|
||||
log_in_user(notification.user)
|
||||
|
||||
request.cookies['cn'] = "2828,100,#{notification.id}"
|
||||
|
||||
get :show, {topic_id: 100}
|
||||
|
||||
expect(response.cookies['cn']).to eq nil
|
||||
|
||||
notification.reload
|
||||
expect(notification.read).to eq true
|
||||
|
||||
end
|
||||
|
||||
it 'correctly clears notifications if specified via header' do
|
||||
notification = Fabricate(:notification)
|
||||
log_in_user(notification.user)
|
||||
|
||||
request.headers['Discourse-Clear-Notifications'] = "2828,100,#{notification.id}"
|
||||
|
||||
get :show, {topic_id: 100}
|
||||
|
||||
notification.reload
|
||||
expect(notification.read).to eq true
|
||||
end
|
||||
end
|
||||
|
||||
describe 'set_locale' do
|
||||
it 'sets the one the user prefers' do
|
||||
SiteSetting.stubs(:allow_user_locale).returns(true)
|
||||
|
Reference in New Issue
Block a user