FEATURE: Add a radial ping when user's first notification has not been read.

This commit is contained in:
Guo Xiang Tan
2016-11-08 16:12:40 +08:00
parent ac2c035856
commit a8b7599d4a
7 changed files with 71 additions and 2 deletions

View File

@ -1314,4 +1314,27 @@ describe User do
end
end
describe '#read_first_notification?' do
let(:user) { Fabricate(:user) }
let(:notification) { Fabricate(:private_message_notification, user: user) }
let(:other_notification) { Fabricate(:private_message_notification, user: user) }
describe 'when first notification has not been read' do
it 'should return the right value' do
notification.update_attributes!(read: false)
other_notification.update_attributes!(read: true)
expect(user.read_first_notification?).to eq(false)
end
end
describe 'when first notification has been read' do
it 'should return the right value' do
notification.update_attributes!(read: true)
other_notification.update_attributes!(read: false)
expect(user.read_first_notification?).to eq(true)
end
end
end
end