From 8a034a15387d6168d4971fabcb71906d7f7cfef8 Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Tue, 30 Oct 2018 13:37:45 +0000 Subject: [PATCH] Fix occurrences of order.shipping_method= by replacing with order.shipments= --- config/locales/en.yml | 1 + spec/models/spree/order_spec.rb | 3 ++- spec/requests/checkout/failed_checkout_spec.rb | 4 ++-- spec/requests/checkout/paypal_spec.rb | 1 - 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 009526aa22..eee58884c5 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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" diff --git a/spec/models/spree/order_spec.rb b/spec/models/spree/order_spec.rb index 04303a8963..ab6ecb7587 100644 --- a/spec/models/spree/order_spec.rb +++ b/spec/models/spree/order_spec.rb @@ -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 diff --git a/spec/requests/checkout/failed_checkout_spec.rb b/spec/requests/checkout/failed_checkout_spec.rb index 6246beadf0..859ca41a1b 100644 --- a/spec/requests/checkout/failed_checkout_spec.rb +++ b/spec/requests/checkout/failed_checkout_spec.rb @@ -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, diff --git a/spec/requests/checkout/paypal_spec.rb b/spec/requests/checkout/paypal_spec.rb index fcbe44f442..fc35f47071 100644 --- a/spec/requests/checkout/paypal_spec.rb +++ b/spec/requests/checkout/paypal_spec.rb @@ -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