mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
In paypal_spec, fixed setting shipping_method in order, this is now done through order shipments
This commit is contained in:
@@ -350,6 +350,13 @@ FactoryBot.define do
|
||||
calculator { Spree::Calculator::FlatRate.new(preferred_amount: 100.55) }
|
||||
end
|
||||
|
||||
trait :distributor do
|
||||
transient do
|
||||
distributor { create :enterprise }
|
||||
end
|
||||
distributors { [distributor] }
|
||||
end
|
||||
|
||||
trait :shipping_fee do
|
||||
transient do
|
||||
shipping_fee 3
|
||||
|
||||
@@ -5,9 +5,9 @@ describe "checking out an order with a paypal express payment method", type: :re
|
||||
|
||||
let!(:address) { create(:address) }
|
||||
let!(:shop) { create(:enterprise) }
|
||||
let!(:shipping_method) { create(:shipping_method, distributor_ids: [shop.id]) }
|
||||
let!(:order) { create(:order, distributor: shop, ship_address: address.dup, bill_address: address.dup) }
|
||||
let!(:shipment) { create(:shipment, order: order, shipping_method: shipping_method) }
|
||||
let!(:shipping_method) { create(:shipping_method_with, :distributor, distributor: shop) }
|
||||
let!(:shipment) { create(:shipment_with, :shipping_method, shipping_method: shipping_method) }
|
||||
let!(:order) { create(:order, distributor: shop, shipments: [shipment], ship_address: address.dup, bill_address: address.dup) }
|
||||
let!(:line_item) { create(:line_item, order: order, quantity: 3, price: 5.00) }
|
||||
let!(:payment_method) { Spree::Gateway::PayPalExpress.create!(name: "PayPalExpress", distributor_ids: [create(:distributor_enterprise).id], environment: Rails.env) }
|
||||
let(:params) { { token: 'lalalala', PayerID: 'payer1', payment_method_id: payment_method.id } }
|
||||
|
||||
Reference in New Issue
Block a user