FEATURE: like notification frequency of never

This commit is contained in:
Sam
2016-03-06 09:12:59 +11:00
parent a656a672a1
commit af577a5854
6 changed files with 21 additions and 2 deletions

View File

@@ -63,6 +63,20 @@ describe PostAlerter do
expect(Notification.count(post_number: 1, topic_id: post.topic_id)).to eq(1)
end
it 'notifies on does not notify when never is selected' do
ActiveRecord::Base.observers.enable :all
post = Fabricate(:post, raw: 'I love waffles')
post.user.user_option.update_columns(like_notification_frequency:
UserOption.like_notification_frequency_type[:never])
PostAction.act(evil_trout, post, PostActionType.types[:like])
expect(Notification.count(post_number: 1, topic_id: post.topic_id)).to eq(0)
end
it 'notifies on likes correctly' do
ActiveRecord::Base.observers.enable :all