From 638d7b1c33feb8ff4c96efa4d9405b44dbb16fcd Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Tue, 23 Jul 2013 17:02:06 +1000 Subject: [PATCH] Stylistic changes, extract commented code to private method --- .../stylesheets/store/openfoodweb.css.scss | 6 +++--- .../add_new_save_checkout_button.html.erb.deface | 3 +-- spec/features/consumer/checkout_spec.rb | 16 +++++++++++----- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/app/assets/stylesheets/store/openfoodweb.css.scss b/app/assets/stylesheets/store/openfoodweb.css.scss index 000cc557a7..909da5a453 100644 --- a/app/assets/stylesheets/store/openfoodweb.css.scss +++ b/app/assets/stylesheets/store/openfoodweb.css.scss @@ -233,9 +233,9 @@ div#eft-payment-alert { /* 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; + display: none; + margin-top: 30px; + padding-top: 10px; border-top: 1px solid #d9d9db; } diff --git a/app/overrides/spree/checkout/edit/add_new_save_checkout_button.html.erb.deface b/app/overrides/spree/checkout/edit/add_new_save_checkout_button.html.erb.deface index a7c14510d1..cf4aed5de1 100644 --- a/app/overrides/spree/checkout/edit/add_new_save_checkout_button.html.erb.deface +++ b/app/overrides/spree/checkout/edit/add_new_save_checkout_button.html.erb.deface @@ -9,8 +9,7 @@ :form=> "checkout_form_#{@order.state}" %> diff --git a/spec/features/consumer/checkout_spec.rb b/spec/features/consumer/checkout_spec.rb index 4e6d9314df..41f26033c5 100644 --- a/spec/features/consumer/checkout_spec.rb +++ b/spec/features/consumer/checkout_spec.rb @@ -135,16 +135,14 @@ feature %q{ page.should have_selector "select#order_distributor_id option[value='#{@distributor_alternative.id}']" #click_button 'Save and Continue' - page.find('#add_new_save_checkout_button input[type=submit]').click + click_continue_button # -- Checkout: Delivery page.should have_selector 'label', :text => "Delivery $3.00" - #click_button 'Save and Continue' - page.find('#add_new_save_checkout_button input[type=submit]').click + click_continue_button # -- Checkout: Payment - #click_button 'Process My Order' - page.find('#add_new_save_checkout_button input[type=submit]').click + click_continue_button # -- Checkout: Order complete page.should have_content('Your order has been processed successfully') @@ -155,4 +153,12 @@ 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