FIX: tests to pass with badges enabled

This commit is contained in:
Sam 2014-07-02 13:11:24 +10:00
parent 5a0aed2bfa
commit 700b3c010f
2 changed files with 6 additions and 5 deletions

View file

@ -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

View file

@ -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