In paypal_spec, fixed setting shipping_method in order, this is now done through order shipments

This commit is contained in:
luisramos0
2018-09-17 00:21:06 +01:00
parent c66b611b99
commit 843cd44b23
2 changed files with 10 additions and 3 deletions

View File

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

View File

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