DEV: Plugin API to add directory columns (#13440)

This commit is contained in:
Mark VanLandingham
2021-06-22 13:00:04 -05:00
committed by GitHub
parent fe5923da06
commit 7fc3d7bdde
33 changed files with 452 additions and 195 deletions

View File

@ -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