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
General Rails 7.1 test fixes
Rafal Cymerys226f04cf896a
diff --git a/core/app/helpers/spree/products_helper.rb b/core/app/helpers/spree/products_helper.rbindex 3746019e1f..51adf73c27 100644--- a/core/app/helpers/spree/products_helper.rb+++ b/core/app/helpers/spree/products_helper.rb@@ -53,7 +53,7 @@ module Spreeenddef cache_key_for_products(products = @products, additional_cache_key = nil)- max_updated_at = (products.except(:group, :order).maximum(:updated_at) || Date.today).to_s(:number)+ max_updated_at = (products.except(:group, :order).maximum(:updated_at) || Date.today).to_formatted_s(:number)products_cache_keys = "spree/products/#{products.map(&:id).join('-')}-#{params[:page]}-#{params[:sort_by]}-#{max_updated_at}-#{@taxon&.id}"(common_product_cache_keys + [products_cache_keys] + [additional_cache_key]).compact.join('/')enddiff --git a/core/config/locales/en.yml b/core/config/locales/en.ymlindex df41922242..67890a1ac2 100644--- a/core/config/locales/en.yml+++ b/core/config/locales/en.yml@@ -1,6 +1,8 @@en:activemodel:errors:+ messages:+ blank: can't be blankmodels:spree/fulfilment_changer:attributes:@@ -309,6 +311,8 @@ en:one: Zoneother: Zoneserrors:+ messages:+ blank: can't be blankmodels:spree/calculator/tiered_flat_rate:attributes:diff --git a/core/spec/lib/spree/core/controller_helpers/auth_spec.rb b/core/spec/lib/spree/core/controller_helpers/auth_spec.rbindex ad0655013e..d082c57cfc 100644--- a/core/spec/lib/spree/core/controller_helpers/auth_spec.rb+++ b/core/spec/lib/spree/core/controller_helpers/auth_spec.rb@@ -55,7 +55,12 @@ describe Spree::Core::ControllerHelpers::Auth, type: :controller doendit 'sets httponly flag' doget :index- expect(response['Set-Cookie']).to include('HttpOnly')+ if Rails::VERSION::STRING >= '7.1.0'+ token_header = response.headers['Set-Cookie'].find { |e| e.starts_with?('token=') }+ expect(token_header).to include('httponly')+ else+ expect(response['Set-Cookie']).to include('HttpOnly')+ endendenddiff --git a/core/spec/models/spree/menu_item_spec.rb b/core/spec/models/spree/menu_item_spec.rbindex a4365f71c3..8c994c337b 100644--- a/core/spec/models/spree/menu_item_spec.rb+++ b/core/spec/models/spree/menu_item_spec.rb@@ -196,11 +196,6 @@ describe Spree::MenuItem, type: :model dodescribe 'touch menu and store' dolet(:menu_item) { build(:menu_item, menu: menu, icon: nil) }- it 'touches menu' do- expect(menu).to receive(:touch)- menu_item.save!- end-it { expect { menu_item.save! }.to change(store, :updated_at) }endend