Fix occurrences of order.shipping_method= by replacing with order.shipments=

This commit is contained in:
luisramos0
2018-10-30 13:37:45 +00:00
parent f32e4dddb1
commit 8a034a1538
4 changed files with 5 additions and 4 deletions

View File

@@ -2383,6 +2383,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using
shipping_methods: "Shipping Methods"
payment_methods: "Payment Methods"
payment_method_fee: "Transaction fee"
payment_processing_failed: "Payment could not be processed, please check the details you entered"
inventory_settings: "Inventory Settings"
tag_rules: "Tag Rules"
shop_preferences: "Shop Preferences"

View File

@@ -842,7 +842,8 @@ describe Spree::Order do
describe '#charge_shipping_and_payment_fees!' do
let(:order) do
build(:order, shipping_method: build(:shipping_method))
shipment = build(:shipment_with, :shipping_method, shipping_method: build(:shipping_method))
build(:order, shipments: [shipment] )
end
context 'after transitioning to payment' do

View File

@@ -7,12 +7,12 @@ describe "checking out an order that initially fails", type: :request do
let!(:order_cycle) { create(:simple_order_cycle) }
let!(:exchange) { create(:exchange, order_cycle: order_cycle, sender: order_cycle.coordinator, receiver: shop, incoming: false, pickup_time: "Monday") }
let!(:address) { create(:address) }
let!(:order) { create(:order, distributor: shop, order_cycle: order_cycle) }
let!(:line_item) { create(:line_item, order: order, quantity: 3, price: 5.00) }
let!(:payment_method) { create(:bogus_payment_method, distributor_ids: [shop.id], environment: Rails.env) }
let!(:check_payment_method) { create(:payment_method, distributor_ids: [shop.id], environment: Rails.env) }
let!(:shipping_method) { create(:shipping_method, distributor_ids: [shop.id]) }
let!(:shipment) { create(:shipment, order: order, shipping_method: shipping_method) }
let!(:shipment) { create(:shipment_with, :shipping_method, shipping_method: shipping_method) }
let!(:order) { create(:order, shipments: [shipment], distributor: shop, order_cycle: order_cycle) }
let(:params) do
{ format: :json, order: {
shipping_method_id: shipping_method.id,

View File

@@ -26,7 +26,6 @@ describe "checking out an order with a paypal express payment method", type: :re
before do
order.reload.update_totals
order.shipping_method = shipping_method
expect(order.next).to be true # => address
expect(order.next).to be true # => delivery
expect(order.next).to be true # => payment