From b99bcc3c12d4b4aade2d90eeea04819220791196 Mon Sep 17 00:00:00 2001 From: Pau Perez Date: Fri, 8 May 2020 15:56:20 +0200 Subject: [PATCH] Make test not depend on response's order I'm assuming this is failing in CI due to the order in which the closed shops are returned. --- spec/controllers/api/shops_controller_spec.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/controllers/api/shops_controller_spec.rb b/spec/controllers/api/shops_controller_spec.rb index 3ae4e55a01..33343e8d84 100644 --- a/spec/controllers/api/shops_controller_spec.rb +++ b/spec/controllers/api/shops_controller_spec.rb @@ -37,8 +37,9 @@ module Api spree_get :closed_shops, nil expect(json_response).not_to match hub.name - expect(json_response[0]['id']).to eq closed_hub1.id - expect(json_response[1]['id']).to eq closed_hub2.id + + response_ids = json_response.map { |shop| shop['id'] } + expect(response_ids).to contain_exactly(closed_hub1.id, closed_hub2.id) end end end