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 spec for not supported currencies

Damian Legawiec16c14b9e5955
diff --git a/api/spec/requests/spree/api/v2/storefront/products_spec.rb b/api/spec/requests/spree/api/v2/storefront/products_spec.rb
index cca3b63ead..946fe27b4d 100644
--- a/api/spec/requests/spree/api/v2/storefront/products_spec.rb
+++ b/api/spec/requests/spree/api/v2/storefront/products_spec.rb
@@ -305,9 +305,10 @@ describe 'API V2 Storefront Products Spec', type: :request do
context 'without supported currency' do
before { get '/api/v2/storefront/products?currency=PLN' }
- it 'returns empty result' do
- expect(json_response['data']).to be_empty
- expect(json_response['data'].count).to be_zero
+ it 'returns results with default currency' do
+ expect(json_response['data']).not_to be_empty
+ expect(json_response['data'][0]['attributes']['currency']).to eq 'USD'
+ expect(json_response['data'][0]['attributes']['display_price']).to match('$')
end
end
end