mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Fixing test regressions
This commit is contained in:
@@ -11,6 +11,7 @@ class CheckoutController < Spree::CheckoutController
|
||||
end
|
||||
|
||||
def update
|
||||
|
||||
if @order.update_attributes(params[:order])
|
||||
fire_event('spree.checkout.update')
|
||||
while @order.state != "complete"
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
:javascript
|
||||
angular.module('Darkswarm').value('order', #{render "checkout/order"})
|
||||
|
||||
-#%pre
|
||||
-#{{ Order.order == order }}
|
||||
%pre
|
||||
{{ Order.order}}
|
||||
|
||||
.small-12.columns
|
||||
%h3.text-center.pad-top
|
||||
@@ -19,5 +19,8 @@
|
||||
= render partial: "checkout/billing", locals: {f: f}
|
||||
= render partial: "checkout/shipping", locals: {f: f}
|
||||
= render partial: "checkout/payment", locals: {f: f}
|
||||
|
||||
%input.button.primary{type: :submit, value: "Place order now", "ng-show" => "checkout.$valid"}
|
||||
%p
|
||||
%input.button.primary{type: :submit,
|
||||
value: "Place order now",
|
||||
"ng-click" => "purchase($event)",
|
||||
"ng-show" => "checkout.$valid"}
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
-#= radio_button_tag "order[shipping_method_id]", ship_method.id, false,
|
||||
-#"ng-model" => "order.shipping_method_id"
|
||||
%input{type: :radio, value: ship_method.id,
|
||||
required: true,
|
||||
"ng-model" => "order.shipping_method_id"}
|
||||
= ship_method.name
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ feature "As a consumer I want to check out my cart", js: true do
|
||||
context "on the checkout page" do
|
||||
before do
|
||||
visit checkout_path
|
||||
checkout_as_guest
|
||||
end
|
||||
|
||||
it "shows all shipping methods, but doesn't show ship address when not needed" do
|
||||
@@ -62,6 +63,7 @@ feature "As a consumer I want to check out my cart", js: true do
|
||||
|
||||
before do
|
||||
visit checkout_path
|
||||
checkout_as_guest
|
||||
toggle_payment
|
||||
end
|
||||
|
||||
@@ -93,7 +95,7 @@ feature "As a consumer I want to check out my cart", js: true do
|
||||
fill_in "Postcode", with: "3066"
|
||||
|
||||
end
|
||||
click_button "Purchase"
|
||||
place_order
|
||||
page.should have_content "Your order has been processed successfully", wait: 10
|
||||
ActionMailer::Base.deliveries.length.should == 1
|
||||
email = ActionMailer::Base.deliveries.last
|
||||
@@ -123,7 +125,7 @@ feature "As a consumer I want to check out my cart", js: true do
|
||||
end
|
||||
toggle_shipping
|
||||
check "Shipping address same as billing address?"
|
||||
click_button "Purchase"
|
||||
place_order
|
||||
page.should have_content "Your order has been processed successfully", wait: 10
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3,10 +3,17 @@ module CheckoutWorkflow
|
||||
have_content "Customer details"
|
||||
end
|
||||
|
||||
def toggle_accordion(id)
|
||||
find("##{id} dd > a").click
|
||||
def checkout_as_guest
|
||||
find("button", text: "Checkout as guest").trigger "click"
|
||||
end
|
||||
|
||||
def place_order
|
||||
click_button "Place order now"
|
||||
end
|
||||
|
||||
def toggle_accordion(id)
|
||||
find("##{id} dd a").trigger "click"
|
||||
end
|
||||
def toggle_details
|
||||
toggle_accordion :details
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user