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 Tests.

Matthew Kennedy23f64c3833ab
diff --git a/backend/app/controllers/spree/admin/products_controller.rb b/backend/app/controllers/spree/admin/products_controller.rb
index 7658e7a46d..9ff705f69c 100644
--- a/backend/app/controllers/spree/admin/products_controller.rb
+++ b/backend/app/controllers/spree/admin/products_controller.rb
@@ -119,7 +119,9 @@ module Spree
params[:q][:s] ||= 'name asc'
- @collection = if params[:q][:all_stores] == '1'
+ # Do not scope by store if the params filter is set to :all_stores,
+ # or we are looking to show deleted products. Deleted products do not have any stores attahced.
+ @collection = if params[:q][:all_stores] == '1' || params[:q][:deleted_at_null] == '0'
super
else
scope
@@ -148,7 +150,7 @@ module Spree
end
def update_before
- # note: we only reset the product properties if we're receiving a post
+ # NOTE: we only reset the product properties if we're receiving a post
# from the form on that tab
return unless params[:clear_product_properties]
diff --git a/backend/spec/features/admin/products/edit/variants_spec.rb b/backend/spec/features/admin/products/edit/variants_spec.rb
index 2c4480b081..0f8bcaf79a 100644
--- a/backend/spec/features/admin/products/edit/variants_spec.rb
+++ b/backend/spec/features/admin/products/edit/variants_spec.rb
@@ -5,7 +5,6 @@ describe 'Product Variants', type: :feature, js: true do
before do
create(:product)
- create(:store, default: true, default_currency: 'USD')
visit spree.admin_products_path
end