mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 20:34:50 +08:00
FIX: Flaky flags spec (#28591)
Because of caching, whenever flags are created, they have to be destroyed to not modify the state.
This commit is contained in:

committed by
GitHub

parent
4f0fe92195
commit
80449d39d3
@ -16,16 +16,12 @@ RSpec.describe FlagSerializer do
|
||||
end
|
||||
|
||||
context "when custom flag" do
|
||||
fab!(:flag) { Fabricate(:flag, name: "custom title", description: "custom description") }
|
||||
|
||||
it "returns translated name" do
|
||||
it "returns translated name and description" do
|
||||
flag = Fabricate(:flag, name: "custom title", description: "custom description")
|
||||
serialized = described_class.new(flag, used_flag_ids: []).as_json
|
||||
expect(serialized[:flag][:name]).to eq("custom title")
|
||||
end
|
||||
|
||||
it "returns translated description" do
|
||||
serialized = described_class.new(flag, used_flag_ids: []).as_json
|
||||
expect(serialized[:flag][:description]).to eq("custom description")
|
||||
flag.destroy!
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user