From 51b6ac3e68a98dca5be2463bae479bce0ee0a86c Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Tue, 18 Mar 2014 17:03:09 +1100 Subject: [PATCH] Fixing one regression bug --- app/controllers/spree/checkout_controller_decorator.rb | 2 +- spec/features/consumer/checkout_spec.rb | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/controllers/spree/checkout_controller_decorator.rb b/app/controllers/spree/checkout_controller_decorator.rb index c0df48d456..66ca7fb034 100644 --- a/app/controllers/spree/checkout_controller_decorator.rb +++ b/app/controllers/spree/checkout_controller_decorator.rb @@ -45,7 +45,7 @@ Spree::CheckoutController.class_eval do past = Spree::Order.order("id desc").where(:email => email).where("state != 'cart'").limit(8) if order = past.detect(&:bill_address) bill_address = order.bill_address.clone if order.bill_address - ship_address = order.ship_address.clone if order.ship_address if order.shipping_method.require_ship_address + ship_address = order.ship_address.clone if order.ship_address and order.shipping_method.andand.require_ship_address end [bill_address, ship_address] diff --git a/spec/features/consumer/checkout_spec.rb b/spec/features/consumer/checkout_spec.rb index c150582ae9..d606eb54fc 100644 --- a/spec/features/consumer/checkout_spec.rb +++ b/spec/features/consumer/checkout_spec.rb @@ -449,16 +449,16 @@ feature %q{ click_link 'Zucchini' click_button 'Add To Cart' find('#checkout-link').click + visit "/checkout" # Force to old checkout # -- Login # We perform login inline because: # a) It's a common user flow # b) It has been known to trigger errors with spree_last_address - within "#checkout_login" do - fill_in 'login_spree_user_email', :with => 'someone@ofn.org' - fill_in 'login_spree_user_password', :with => 'passw0rd' - click_button 'Login' - end + fill_in 'spree_user_email', :with => 'someone@ofn.org' + fill_in 'spree_user_password', :with => 'passw0rd' + click_button 'Login' + visit "/checkout" # Force to old checkout # -- Checkout: Address page.should have_field 'order_bill_address_attributes_firstname', with: 'Joe'