mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-13 04:00:21 +00:00
Add new 'Checkout options' step to the edit order cycle form so people can attach shipping methods
This commit is contained in:
committed by
Filipe
parent
1e817af5aa
commit
855ec1a708
@@ -677,6 +677,24 @@ describe OrderCycle do
|
||||
end
|
||||
end
|
||||
|
||||
describe "#attachable_shipping_methods" do
|
||||
it "includes shipping methods from the distributors on the order cycle" do
|
||||
shipping_method = create(:shipping_method)
|
||||
enterprise = create(:enterprise, shipping_methods: [shipping_method])
|
||||
oc = create(:simple_order_cycle, distributors: [enterprise])
|
||||
|
||||
expect(oc.attachable_shipping_methods).to eq([shipping_method])
|
||||
end
|
||||
|
||||
it "does not include backoffice only shipping methods" do
|
||||
shipping_method = create(:shipping_method, display_on: "back_end")
|
||||
enterprise = create(:enterprise, shipping_methods: [shipping_method])
|
||||
oc = create(:simple_order_cycle, distributors: [enterprise])
|
||||
|
||||
expect(oc.attachable_shipping_methods).to be_empty
|
||||
end
|
||||
end
|
||||
|
||||
describe "#simple?" do
|
||||
it "returns true if the coordinator sells their own products i.e. shops" do
|
||||
order_cycle = build(:simple_order_cycle, coordinator: build(:enterprise, sells: "own"))
|
||||
|
||||
Reference in New Issue
Block a user