Skip to content

Commit b1786c4

Browse files
authored
Fix flaky ExportCreateService spec (#4862)
This test expects the requests in the export to be in a particular order, but no order is applied to the requests passed in and no order is defined in the ExportCreateService itself, hence the flakiness. Example failure: https://github.com/rubyforgood/human-essentials/actions/runs/12353561322/job/34472934783#step:7:1433
1 parent 75af9ad commit b1786c4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

spec/services/exports/export_request_service_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@
237237
end
238238

239239
it "has expected data for the 3T Diapers request" do
240-
expect(subject[1]).to eq([
240+
expect(subject).to include([
241241
request_3t.created_at.strftime("%m/%d/%Y").to_s,
242242
"Howdy Partner",
243243
"Child",
@@ -250,7 +250,7 @@
250250
end
251251

252252
it "has expected data for the 2T Diapers request" do
253-
expect(subject[2]).to eq([
253+
expect(subject).to include([
254254
request_2t.created_at.strftime("%m/%d/%Y").to_s,
255255
"Howdy Partner",
256256
"Individual",
@@ -263,7 +263,7 @@
263263
end
264264

265265
it "has expected data for the request with deleted items" do
266-
expect(subject[3]).to eq([
266+
expect(subject).to include([
267267
request_with_deleted_items.created_at.strftime("%m/%d/%Y").to_s,
268268
"Howdy Partner",
269269
nil,
@@ -276,7 +276,7 @@
276276
end
277277

278278
it "has expected data for the request with multiple items" do
279-
expect(subject[4]).to eq([
279+
expect(subject).to include([
280280
request_with_multiple_items.created_at.strftime("%m/%d/%Y").to_s,
281281
"Howdy Partner",
282282
nil,
@@ -289,7 +289,7 @@
289289
end
290290

291291
it "has expected data for the request with 4T diapers without pack unit" do
292-
expect(subject[5]).to eq([
292+
expect(subject).to include([
293293
request_4t.created_at.strftime("%m/%d/%Y").to_s,
294294
"Howdy Partner",
295295
"Quantity",
@@ -302,7 +302,7 @@
302302
end
303303

304304
it "has expected data for the request with 4T diapers with pack unit" do
305-
expect(subject[6]).to eq([
305+
expect(subject).to include([
306306
request_4t_pack.created_at.strftime("%m/%d/%Y").to_s,
307307
"Howdy Partner",
308308
"Quantity",

0 commit comments

Comments
 (0)