fix test
This commit is contained in:
parent
2e85a9fe66
commit
13407f700e
1 changed files with 7 additions and 7 deletions
|
|
@ -14,22 +14,22 @@ describe NotificationsController do
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#destroy' do
|
describe '#update' do
|
||||||
it 'removes a notification' do
|
it 'marks a notification as read' do
|
||||||
note = Notification.create(:user_id => user.id)
|
note = Notification.create(:user_id => user.id)
|
||||||
delete :destroy, :id => note.id
|
put :update, :id => note.id
|
||||||
Notification.count.should == 0
|
Notification.first.unread.should == false
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'only lets you delete your own notifications' do
|
it 'only lets you read your own notifications' do
|
||||||
user2 = make_user
|
user2 = make_user
|
||||||
|
|
||||||
Notification.create(:user_id => user.id)
|
Notification.create(:user_id => user.id)
|
||||||
note = Notification.create(:user_id => user2.id)
|
note = Notification.create(:user_id => user2.id)
|
||||||
|
|
||||||
delete :destroy, :id => note.id
|
put :update, :id => note.id
|
||||||
|
|
||||||
Notification.count.should == 2
|
Notification.find(note.id).unread.should == true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue