Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Fix API V2 Platform products for store specs (#11283)

Szymon Iwacz42acab14f1ed
diff --git a/api/spec/requests/spree/api/v2/platform/products_spec.rb b/api/spec/requests/spree/api/v2/platform/products_spec.rb
index 57308978d7..386787ab30 100644
--- a/api/spec/requests/spree/api/v2/platform/products_spec.rb
+++ b/api/spec/requests/spree/api/v2/platform/products_spec.rb
@@ -64,10 +64,10 @@ describe 'API V2 Platform Products Spec' do
it 'returns products from this store only' do
expect(json_response['data'].count).to eq store.products.count
- product_ids = json_response['data'].map(&:first).map(&:last)
+ product_ids = json_response['data'].pluck(:id)
expect(product_ids).not_to include(product_from_another_store.id)
- expect(product_ids).to eq(store.products.ids.map(&:to_s))
+ expect(product_ids).to match_array(store.products.ids.map(&:to_s))
end
end