Patching the paypal test

This commit is contained in:
Will Marshall
2014-03-07 15:18:26 +11:00
parent df435c0a38
commit 40c986892e
2 changed files with 3 additions and 3 deletions

View File

@@ -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

View File

@@ -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