Merge pull request #6641 from Matt-Yorkley/shipping-method-soft-deletion

Ensure ShippingMethod is correctly using soft-deletion
This commit is contained in:
Andy Brett
2021-01-14 11:53:19 -08:00
committed by GitHub
2 changed files with 11 additions and 0 deletions

View File

@@ -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) }

View File

@@ -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 }