mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-19 04:49:15 +00:00
Add soft-deletion test coverage to Package#shipping_methods
This commit is contained in:
@@ -158,11 +158,18 @@ module OrderManagement
|
||||
|
||||
let(:shipping_method1) { create(:shipping_method, distributors: [enterprise]) }
|
||||
let(:shipping_method2) { create(:shipping_method, distributors: [other_enterprise]) }
|
||||
let!(:shipping_method3) {
|
||||
create(:shipping_method, distributors: [enterprise], deleted_at: Time.zone.now)
|
||||
}
|
||||
|
||||
describe '#shipping_methods' do
|
||||
it 'does not return shipping methods not used by the package\'s order distributor' do
|
||||
describe "#shipping_methods" do
|
||||
it "does not return shipping methods not used by the package's order distributor" do
|
||||
expect(package.shipping_methods).to eq [shipping_method1]
|
||||
end
|
||||
|
||||
it "does not return soft-deleted shipping methods" do
|
||||
expect(package.shipping_methods).to_not include shipping_method3
|
||||
end
|
||||
end
|
||||
|
||||
describe '#shipping_categories' do
|
||||
|
||||
Reference in New Issue
Block a user