mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 02:19:27 +08:00
DEV: Leaking state in PostActionNotifier
in tests take 2.
Follow-up to a3b48826
This commit is contained in:
parent
a3b4882665
commit
5270cd97ef
|
@ -4,13 +4,17 @@ class PostActionNotifier
|
|||
|
||||
def self.disable
|
||||
@disabled = true
|
||||
@custom_post_revision_notifier_recipients = nil
|
||||
end
|
||||
|
||||
def self.enable
|
||||
@disabled = false
|
||||
end
|
||||
|
||||
# For testing purposes
|
||||
def self.reset!
|
||||
@custom_post_revision_notifier_recipients = nil
|
||||
end
|
||||
|
||||
def self.alerter
|
||||
@alerter ||= PostAlerter.new
|
||||
end
|
||||
|
|
|
@ -108,6 +108,10 @@ describe PostActionNotifier do
|
|||
end
|
||||
end
|
||||
|
||||
after do
|
||||
PostActionNotifier.reset!
|
||||
end
|
||||
|
||||
it 'notifies the specified user of the revision' do
|
||||
expect {
|
||||
post.revise(evil_trout, raw: "world is the new body of the message")
|
||||
|
|
Loading…
Reference in New Issue
Block a user