2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 09:10:25 +08:00

FIX: Better handling for toggling must_approve_users

If you turn it on now, default all users to approved since they were
previously. Also support approving a user that doesn't have a reviewable
record (it will be created first.)

This also includes a refactor to move class method calls to
`DiscourseEvent` into an initializer. Otherwise the load order of
classes makes a difference in the test environment and some settings
might be triggered and others not, randomly.
This commit is contained in:
Robin Ward 2019-04-16 14:42:47 -04:00
parent cec0b580e6
commit ba6d4b2a8d
20 changed files with 103 additions and 61 deletions

View file

@ -434,7 +434,7 @@ describe Category do
end
it 'triggers a extensibility event' do
event = DiscourseEvent.track_events { @category.destroy }.first
event = DiscourseEvent.track(:category_destroyed) { @category.destroy }
expect(event[:event_name]).to eq(:category_destroyed)
expect(event[:params].first).to eq(@category)