mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
FIX: tests to pass with badges enabled
This commit is contained in:
parent
5a0aed2bfa
commit
700b3c010f
2 changed files with 6 additions and 5 deletions
|
@ -15,7 +15,8 @@ describe PostAlertObserver do
|
|||
it 'creates a notification' do
|
||||
lambda {
|
||||
PostAction.act(evil_trout, post, PostActionType.types[:like])
|
||||
}.should change(Notification, :count).by(1)
|
||||
# one like and one welcome badge
|
||||
}.should change(Notification, :count).by(2)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -76,14 +76,14 @@ describe PostTiming do
|
|||
|
||||
PostAction.act(user2, post, PostActionType.types[:like])
|
||||
|
||||
post.user.unread_notifications.should == 1
|
||||
post.user.unread_notifications_by_type.should == { Notification.types[:liked] => 1 }
|
||||
post.user.unread_notifications.should == 2
|
||||
post.user.unread_notifications_by_type.should == {Notification.types[:granted_badge] => 1, Notification.types[:liked] => 1 }
|
||||
|
||||
PostTiming.process_timings(post.user, post.topic_id, 1, [[post.post_number, 100]])
|
||||
|
||||
post.user.reload
|
||||
post.user.unread_notifications_by_type.should == {}
|
||||
post.user.unread_notifications.should == 0
|
||||
post.user.unread_notifications_by_type.should == {Notification.types[:granted_badge] => 1}
|
||||
post.user.unread_notifications.should == 1
|
||||
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue