mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-14 04:04:23 +00:00
Patching the paypal test
This commit is contained in:
@@ -14,8 +14,6 @@ class Shop::CheckoutController < Spree::CheckoutController
|
||||
def update
|
||||
if @order.update_attributes(params[:order])
|
||||
fire_event('spree.checkout.update')
|
||||
|
||||
|
||||
while @order.state != "complete"
|
||||
if @order.state == "payment"
|
||||
return if redirect_to_paypal_express_form_if_needed
|
||||
@@ -106,7 +104,8 @@ class Shop::CheckoutController < Spree::CheckoutController
|
||||
true
|
||||
|
||||
end
|
||||
|
||||
|
||||
# Overriding to customize the cancel url
|
||||
def order_opts_with_new_cancel_return_url(order, payment_method_id, stage)
|
||||
opts = order_opts_without_new_cancel_return_url(order, payment_method_id, stage)
|
||||
opts[:cancel_return_url] = main_app.shop_checkout_url
|
||||
|
||||
@@ -60,6 +60,7 @@ describe Shop::CheckoutController do
|
||||
it "should check the payment method for Paypalness if we've selected one" do
|
||||
Spree::PaymentMethod.should_receive(:find).with(payment_method.id.to_s).and_return payment_method
|
||||
order.stub(:update_attributes).and_return true
|
||||
order.stub(:state).and_return "payment"
|
||||
spree_post :update, order: {payments_attributes: [{payment_method_id: payment_method.id}]}
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user