Fixing one regression bug

This commit is contained in:
Will Marshall
2014-03-18 17:03:09 +11:00
parent 49789c865e
commit 51b6ac3e68
2 changed files with 6 additions and 6 deletions

View File

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

View File

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