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
Add test for clearing selection
Matthew Kennedy829ba37dfca0
diff --git a/core/spec/models/spree/menu_item_spec.rb b/core/spec/models/spree/menu_item_spec.rbindex f523ef6b0e..7b4d8b2ad1 100644--- a/core/spec/models/spree/menu_item_spec.rb+++ b/core/spec/models/spree/menu_item_spec.rb@@ -98,12 +98,26 @@ describe Spree::MenuItem, type: :model doexpect(item_taxon.destination).to eql "/t/#{taxon.permalink}"end+ it 'returns nil for destination when taxon is removed' do+ item_taxon.update(linked_resource_id: taxon.id)+ item_taxon.update(linked_resource_id: nil)++ expect(item_taxon.destination).to eql nil+ end+it 'returns product path' doitem_product.update(linked_resource_id: product.id)expect(item_product.destination).to eql "/products/#{product.slug}"end+ it 'returns nil for destination when product is removed' do+ item_product.update(linked_resource_id: product.id)+ item_product.update(linked_resource_id: nil)++ expect(item_product.destination).to eql nil+ end+it 'returns root path' doexpect(item_home.destination).to eql '/'end