FIX: change around to after in flag spec (#27168)

This commit is contained in:
Krzysztof Kotlarek 2024-05-24 12:55:21 +10:00 committed by GitHub
parent df16ab0758
commit 99e27c4fd5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 5 deletions

View File

@ -1,21 +1,19 @@
# frozen_string_literal: true
RSpec.describe Flag, type: :model do
around do |test|
Flag.reset_flag_settings!
test.call
Flag.reset_flag_settings!
end
after(:each) { Flag.reset_flag_settings! }
it "has id lower than 1000 for system flags" do
flag = Fabricate(:flag, id: 1)
expect(flag.system?).to be true
flag.destroy!
end
it "has id greater than 1000 for non-system flags" do
flag = Fabricate(:flag)
expect(flag.system?).to be false
expect(flag.id).to be > 1000
flag.destroy!
end
it "has correct name key" do
@ -27,6 +25,8 @@ RSpec.describe Flag, type: :model do
flag.update!(name: "THIS IS SPaM!+)(*&^%$#@@@!)")
expect(flag.name_key).to eq("this_is_spam")
flag.destroy!
end
it "updates post action types when created, modified or destroyed" do