diff --git a/spec/models/post_alert_observer_spec.rb b/spec/models/post_alert_observer_spec.rb index 8e16f6cbe..64da4ecfd 100644 --- a/spec/models/post_alert_observer_spec.rb +++ b/spec/models/post_alert_observer_spec.rb @@ -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 diff --git a/spec/models/post_timing_spec.rb b/spec/models/post_timing_spec.rb index 47d48efff..7b7564e21 100644 --- a/spec/models/post_timing_spec.rb +++ b/spec/models/post_timing_spec.rb @@ -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