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.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Fix api v2 products available on specs (#11273)
Szymon Iwacz985b948ac58f
diff --git a/.circleci/config.yml b/.circleci/config.ymlindex ab6634c800..358ebfa7e5 100644--- a/.circleci/config.yml+++ b/.circleci/config.yml@@ -25,8 +25,8 @@ run_tests: &run_tests- checkout- restore_cache:keys:- - spree-bundle-v8-ruby-2-7-{{ .Branch }}- - spree-bundle-v8-ruby-2-7+ - spree-bundle-v9-ruby-2-7-{{ .Branch }}+ - spree-bundle-v9-ruby-2-7- run:name: Run rspec in parallelcommand: ./bin/build-ci.rb test@@ -46,8 +46,8 @@ run_tests_3_0: &run_tests_3_0- checkout- restore_cache:keys:- - spree-bundle-v8-ruby-3-0-{{ .Branch }}- - spree-bundle-v8-ruby-3-0+ - spree-bundle-v9-ruby-3-0-{{ .Branch }}+ - spree-bundle-v9-ruby-3-0- run:name: Run rspec in parallelcommand: ./bin/build-ci.rb test@@ -67,15 +67,15 @@ jobs:- checkout- restore_cache:keys:- - spree-bundle-v8-ruby-2-7-{{ .Branch }}- - spree-bundle-v8-ruby-2-7+ - spree-bundle-v9-ruby-2-7-{{ .Branch }}+ - spree-bundle-v9-ruby-2-7- run:name: Bundle Installcommand: |bundle check || bundle install./bin/build-ci.rb install- save_cache:- key: spree-bundle-v8-ruby-2-7-{{ .Branch }}-{{ checksum "Gemfile.lock" }}+ key: spree-bundle-v9-ruby-2-7-{{ .Branch }}-{{ checksum "Gemfile.lock" }}paths:- ~/spree/vendor/bundle@@ -85,15 +85,15 @@ jobs:- checkout- restore_cache:keys:- - spree-bundle-v8-ruby-3-0-{{ .Branch }}- - spree-bundle-v8-ruby-3-0+ - spree-bundle-v9-ruby-3-0-{{ .Branch }}+ - spree-bundle-v9-ruby-3-0- run:name: Bundle Installcommand: |bundle check || bundle install./bin/build-ci.rb install- save_cache:- key: spree-bundle-v8-ruby-3-0-{{ .Branch }}-{{ checksum "Gemfile.lock" }}+ key: spree-bundle-v9-ruby-3-0-{{ .Branch }}-{{ checksum "Gemfile.lock" }}paths:- ~/spree/vendor/bundle@@ -129,8 +129,8 @@ jobs:- checkout- restore_cache:keys:- - spree-bundle-v8-ruby-2-7-{{ .Branch }}- - spree-bundle-v8-ruby-2-7+ - spree-bundle-v9-ruby-2-7-{{ .Branch }}+ - spree-bundle-v9-ruby-2-7- run:name: Ensure Bundle Installcommand: |@@ -157,8 +157,8 @@ jobs:- checkout- restore_cache:keys:- - spree-bundle-v8-ruby-2-7-{{ .Branch }}- - spree-bundle-v8-ruby-2-7+ - spree-bundle-v9-ruby-2-7-{{ .Branch }}+ - spree-bundle-v9-ruby-2-7- run:name: Ensure Bundle Installcommand: |@@ -203,8 +203,8 @@ jobs:- checkout- restore_cache:keys:- - spree-bundle-v8-ruby-3-0-{{ .Branch }}- - spree-bundle-v8-ruby-3-0+ - spree-bundle-v9-ruby-3-0-{{ .Branch }}+ - spree-bundle-v9-ruby-3-0- run:name: Run rspec in parallelcommand: ./bin/build-ci.rb testdiff --git a/api/spec/requests/spree/api/v2/platform/products_spec.rb b/api/spec/requests/spree/api/v2/platform/products_spec.rbindex 103857fc2b..00c1503ec4 100644--- a/api/spec/requests/spree/api/v2/platform/products_spec.rb+++ b/api/spec/requests/spree/api/v2/platform/products_spec.rb@@ -169,6 +169,8 @@ describe 'API V2 Platform Products Spec' doendcontext 'sorting by available_on' do+ before { store.products.each_with_index { |p, i| p.update(available_on: Time.current - i.days) } }+context 'ascending order' dobefore { get '/api/v2/platform/products?sort=available_on', headers: bearer_token }diff --git a/api/spec/requests/spree/api/v2/storefront/products_spec.rb b/api/spec/requests/spree/api/v2/storefront/products_spec.rbindex 02244e1e95..0c3a7766ad 100644--- a/api/spec/requests/spree/api/v2/storefront/products_spec.rb+++ b/api/spec/requests/spree/api/v2/storefront/products_spec.rb@@ -427,6 +427,8 @@ describe 'API V2 Storefront Products Spec', type: :request doendcontext 'sorting by available_on' do+ before { store.products.each_with_index { |p, i| p.update(available_on: Time.current - i.days) } }+context 'ascending order' dobefore { get '/api/v2/storefront/products?sort=available_on' }