Fix test regressions with multiple 'Save and Continue' buttons in checkout

This commit is contained in:
Rohan Mitchell
2013-07-23 17:48:54 +10:00
parent dd97768947
commit 1d5e970b47
4 changed files with 14 additions and 15 deletions

View File

@@ -106,8 +106,8 @@ feature "enterprises distributor info as rich text" do
select('Australia', :from => 'order_bill_address_attributes_country_id')
select('Victoria', :from => 'order_bill_address_attributes_state_id')
click_button 'Save and Continue'
click_button 'Save and Continue'
click_button 'Process My Order'
click_checkout_continue_button
click_checkout_continue_button
click_checkout_continue_button
end
end

View File

@@ -192,15 +192,14 @@ feature %q{
# Disabled until this form takes order cycles into account
# page.should have_selector "select#order_distributor_id option[value='#{@distributor_alternative.id}']"
#click_button 'Save and Continue'
click_continue_button
click_checkout_continue_button
# -- Checkout: Delivery
page.should have_selector 'label', :text => "Delivery $3.00"
click_continue_button
click_checkout_continue_button
# -- Checkout: Payment
click_continue_button
click_checkout_continue_button
# -- Checkout: Order complete
page.should have_content('Your order has been processed successfully')
@@ -211,12 +210,4 @@ feature %q{
# page.should have_content('On Tuesday, 4 PM')
# page.should have_content('12 Bungee Rd, Carion')
end
private
def click_continue_button
page.find('#add_new_save_checkout_button input[type=submit]').click
end
end

View File

@@ -65,6 +65,7 @@ RSpec.configure do |config|
config.include Rails.application.routes.url_helpers
config.include Spree::UrlHelpers
config.include Spree::CheckoutHelpers
config.include Spree::Core::TestingSupport::ControllerRequests, :type => :controller
config.include Devise::TestHelpers, :type => :controller

View File

@@ -0,0 +1,7 @@
module Spree
module CheckoutHelpers
def click_checkout_continue_button
page.find('#add_new_save_checkout_button input[type=submit]').click
end
end
end