mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:42:07 +08:00
493d437e79
* Remove outdated option
04078317ba
* Use the non-globally exposed RSpec syntax
https://github.com/rspec/rspec-core/pull/2803
* Use the non-globally exposed RSpec syntax, cont
https://github.com/rspec/rspec-core/pull/2803
* Comply to strict predicate matchers
See:
- https://github.com/rspec/rspec-expectations/pull/1195
- https://github.com/rspec/rspec-expectations/pull/1196
- https://github.com/rspec/rspec-expectations/pull/1277
19 lines
620 B
Ruby
19 lines
620 B
Ruby
# frozen_string_literal: true
|
|
|
|
RSpec.describe PostAction do
|
|
|
|
it "triggers the 'flag_reviewed' event when there was at least one flag" do
|
|
admin = Fabricate(:admin)
|
|
|
|
post = Fabricate(:post)
|
|
events = DiscourseEvent.track_events { PostDestroyer.new(admin, post).destroy }
|
|
expect(events.map { |e| e[:event_name] }).to_not include(:flag_reviewed)
|
|
|
|
flagged_post = Fabricate(:post)
|
|
PostActionCreator.spam(admin, flagged_post)
|
|
events = DiscourseEvent.track_events { PostDestroyer.new(admin, flagged_post).destroy }
|
|
expect(events.map { |e| e[:event_name] }).to include(:flag_reviewed)
|
|
end
|
|
|
|
end
|