mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
UserEmailObserver is now removed
no big surprises here was pretty straightforward after_commit semantics sure are weird though
This commit is contained in:
@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user