mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 23:31:18 +08:00
FIX: flaky post action counts specs (#27165)
After flags were moved to the database, with each save they are changing available PostActionTypes. Therefore, flag specs should clear the state before and after each example not just before. In addition, we need to clear `nil` counts for dynamically created flags from serializer.
This commit is contained in:

committed by
GitHub

parent
3a3ee5e04a
commit
a4c5f85b10
@ -1,7 +1,11 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
RSpec.describe Flag, type: :model do
|
||||
before { Flag.reset_flag_settings! }
|
||||
around do |test|
|
||||
Flag.reset_flag_settings!
|
||||
test.call
|
||||
Flag.reset_flag_settings!
|
||||
end
|
||||
|
||||
it "has id lower than 1000 for system flags" do
|
||||
flag = Fabricate(:flag, id: 1)
|
||||
|
Reference in New Issue
Block a user