Merge branch 'move-save-checkout-button'

Conflicts:
	spec/features/consumer/checkout_spec.rb
This commit is contained in:
Rohan Mitchell
2013-07-23 17:03:00 +10:00
4 changed files with 36 additions and 4 deletions

View File

@@ -278,6 +278,14 @@ div#eft-payment-alert {
border: 2px solid red;
}
/* Large 'Save and Continue/Process My Order' button under Order Summary on the checkout pages */
#add_new_save_checkout_button {
display: none;
margin-top: 30px;
padding-top: 10px;
border-top: 1px solid #d9d9db;
}
/* Cleared div for clearing previous floating elements */
div.cleared {
clear: both;

View File

@@ -2,4 +2,4 @@ Deface::Override.new(:virtual_path => "spree/checkout/_payment",
:replace => "code[erb-loud]:contains('submit_tag t(:save_and_continue)')",
:text => "<%= submit_tag 'Process My Order', :class => 'continue button primary' %>",
:name => "replace_checkout_payment_button",
:original => 'ce2043a01931b3bc16b045302ebb0e0bb9150b67')
:original => 'ce2043a01931b3bc16b045302ebb0e0bb9150b67')

View File

@@ -0,0 +1,16 @@
<!-- insert_after '[data-hook="checkout_summary_box"]'
sequence :before => 'add_change_distributor_form_to_checkout_address' -->
<% # Add a new 'Save and Continue/Process My Order' button under Order Summary on the checkout pages %>
<div id="add_new_save_checkout_button" class="columns omega four">
<%= submit_tag @order.state == "payment" ? "Process My Order" : t(:save_and_continue),
:class => "continue button primary large",
:form=> "checkout_form_#{@order.state}" %>
<script>
//Show additional button only if form attribute is supported
if ($("#add_new_save_checkout_button input[type=submit]")[0].form) {
$("#add_new_save_checkout_button").show();
}
</script>
</div>

View File

@@ -192,14 +192,15 @@ 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_button 'Save and Continue'
click_continue_button
# -- Checkout: Delivery
page.should have_selector 'label', :text => "Delivery $3.00"
click_button 'Save and Continue'
click_continue_button
# -- Checkout: Payment
click_button 'Process My Order'
click_continue_button
# -- Checkout: Order complete
page.should have_content('Your order has been processed successfully')
@@ -211,4 +212,11 @@ feature %q{
# 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