mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 14:12:10 +08:00
DEV: Plugin API to add directory columns (#13440)
This commit is contained in:

committed by
GitHub

parent
fe5923da06
commit
7fc3d7bdde
@ -83,9 +83,25 @@ describe DiscourseEvent do
|
||||
expect(harvey.job).to eq('Supervillain')
|
||||
expect(harvey.name).to eq('Two Face')
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
context '#all_off' do
|
||||
|
||||
let(:event_handler_2) do
|
||||
Proc.new { |user| user.job = 'Supervillain' }
|
||||
end
|
||||
|
||||
before do
|
||||
DiscourseEvent.on(:acid_face, &event_handler_2)
|
||||
end
|
||||
|
||||
it 'removes all handlers with a key' do
|
||||
harvey.job = 'gardening'
|
||||
DiscourseEvent.all_off(:acid_face)
|
||||
DiscourseEvent.trigger(:acid_face, harvey) # Doesn't change anything
|
||||
expect(harvey.job).to eq('gardening')
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user