mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Ensure ShippingMethod#destroy is using soft-deletion
25f5c2daf8
We've already applied some of the changes in this commit during previous Spree upgrade work, but there were a couple of bits missing.
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