DEV: Fix flaky uploads:disable_secure_uploads spec (#18719)

This test flakes occassionally, possibly because
of the arg ordering which we do not guarantee.
In future if this keeps occurring we may want to
try make expect_enqueued_with not care about argument
orders or the order of arrays etc within those arguments.
This commit is contained in:
Martin Brennan
2022-10-25 09:01:15 +10:00
committed by GitHub
parent 0730a56ce7
commit cde2719ea1

View File

@ -209,13 +209,11 @@ RSpec.describe "tasks/uploads" do
expect(post2.reload.baked_at).not_to eq_time(1.week.ago) expect(post2.reload.baked_at).not_to eq_time(1.week.ago)
end end
it "updates the affected ACLs" do it "updates the affected ACLs via the SyncAclsForUploads job" do
expect_enqueued_with( invoke_task
job: :sync_acls_for_uploads, expect(Jobs::SyncAclsForUploads.jobs.last["args"][0]["upload_ids"]).to match_array(
args: { upload_ids: [upload1.id, upload2.id, upload3.id, upload4.id] }, [upload1.id, upload2.id, upload3.id, upload4.id]
) do )
invoke_task
end
end end
end end
end end