UserEmailObserver is now removed

no big surprises here was pretty straightforward

after_commit semantics sure are weird though
This commit is contained in:
Sam
2016-12-22 15:29:34 +11:00
parent 2f6a4cc6de
commit 019f1a1d06
7 changed files with 38 additions and 34 deletions

View File

@ -3,6 +3,7 @@ require 'rails_helper'
describe Notification do
before do
ActiveRecord::Base.observers.enable :all
NotificationEmailer.enable
end
it { is_expected.to validate_presence_of :notification_type }
@ -139,21 +140,6 @@ describe Notification do
end
end
describe '@mention' do
it "calls email_user_mentioned on creating a notification" do
UserEmailObserver.any_instance.expects(:after_commit).with(instance_of(Notification))
Fabricate(:notification)
end
end
describe '@mention' do
it "calls email_user_quoted on creating a quote notification" do
UserEmailObserver.any_instance.expects(:after_commit).with(instance_of(Notification))
Fabricate(:quote_notification)
end
end
describe 'private message' do
before do
@ -250,6 +236,8 @@ describe Notification do
it 'deletes notifications if post is missing or deleted' do
ActiveRecord::Base.observers.disable :all
NotificationEmailer.disable
p = Fabricate(:post)
p2 = Fabricate(:post)