DEV: flaky flags specs (#27362)
When flags are modified, we always need to reset the state to the original values.
This commit is contained in:
parent
343430fe77
commit
593a9b05cd
|
@ -31,6 +31,10 @@ RSpec.describe(ReorderFlag) do
|
||||||
context "when user is allowed to perform the action" do
|
context "when user is allowed to perform the action" do
|
||||||
fab!(:current_user) { Fabricate(:admin) }
|
fab!(:current_user) { Fabricate(:admin) }
|
||||||
|
|
||||||
|
after do
|
||||||
|
described_class.call(flag_id: flag.id, guardian: current_user.guardian, direction: "down")
|
||||||
|
end
|
||||||
|
|
||||||
it "sets the service result as successful" do
|
it "sets the service result as successful" do
|
||||||
expect(result).to be_a_success
|
expect(result).to be_a_success
|
||||||
end
|
end
|
||||||
|
|
|
@ -14,6 +14,8 @@ RSpec.describe(ToggleFlag) do
|
||||||
context "when user is allowed to perform the action" do
|
context "when user is allowed to perform the action" do
|
||||||
fab!(:current_user) { Fabricate(:admin) }
|
fab!(:current_user) { Fabricate(:admin) }
|
||||||
|
|
||||||
|
after { flag.update!(enabled: true) }
|
||||||
|
|
||||||
it "sets the service result as successful" do
|
it "sets the service result as successful" do
|
||||||
expect(result).to be_a_success
|
expect(result).to be_a_success
|
||||||
end
|
end
|
||||||
|
|
|
@ -25,6 +25,8 @@ describe "Admin Flags Page", type: :system do
|
||||||
expect(all(".flag-action-type-details strong").map(&:text)).to eq(
|
expect(all(".flag-action-type-details strong").map(&:text)).to eq(
|
||||||
["Something Else", "It's Inappropriate", "It's Illegal"],
|
["Something Else", "It's Inappropriate", "It's Illegal"],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Flag.system.where(name: "spam").update!(enabled: true)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "allows admin to change order of flags" do
|
it "allows admin to change order of flags" do
|
||||||
|
|
Loading…
Reference in New Issue