mirror of
https://github.com/discourse/discourse.git
synced 2025-03-21 09:48:55 +08:00
Properly clean up plugin event in specs..
This commit is contained in:
parent
aabb7a8592
commit
aa1f306894
@ -49,7 +49,7 @@ describe Plugin::Instance do
|
||||
# DiscourseEvent
|
||||
@hello_count = 0
|
||||
@increase_count = -> { @hello_count += 1 }
|
||||
@plugin.on(:hello, &@increase_count)
|
||||
@set = @plugin.on(:hello, &@increase_count)
|
||||
|
||||
# Serializer
|
||||
@plugin.add_to_serializer(:trout, :scales) { 1024 }
|
||||
@ -57,7 +57,7 @@ describe Plugin::Instance do
|
||||
end
|
||||
|
||||
after do
|
||||
DiscourseEvent.off(:hello, &@increase_count)
|
||||
DiscourseEvent.off(:hello, &@set.last)
|
||||
end
|
||||
|
||||
it "checks enabled/disabled functionality for extensions" do
|
||||
|
Loading…
x
Reference in New Issue
Block a user