mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Merge pull request #6641 from Matt-Yorkley/shipping-method-soft-deletion
Ensure ShippingMethod is correctly using soft-deletion
This commit is contained in:
@@ -5,6 +5,7 @@ module Spree
|
||||
include Spree::Core::CalculatedAdjustments
|
||||
DISPLAY = [:both, :front_end, :back_end].freeze
|
||||
|
||||
acts_as_paranoid
|
||||
acts_as_taggable
|
||||
|
||||
default_scope -> { where(deleted_at: nil) }
|
||||
|
||||
@@ -159,6 +159,16 @@ module Spree
|
||||
end
|
||||
end
|
||||
|
||||
# Regression test for Spree #4320
|
||||
context "soft deletion" do
|
||||
let(:shipping_method) { create(:shipping_method) }
|
||||
|
||||
it "soft-deletes when destroy is called" do
|
||||
shipping_method.destroy
|
||||
expect(shipping_method.deleted_at).to_not be_blank
|
||||
end
|
||||
end
|
||||
|
||||
context 'factory' do
|
||||
let(:shipping_method){ create :shipping_method }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user