Remove the 'confirm' step from the order checkout flow

This step is not being responded to anyway, since we are not rending a page for each checkout step

It was causing an issue whereby an order in the 'confirm' state was not able to progress through the
checkout controller because it was expecting to only redirect to paypal from the 'payment' state.
figured it was easiest to just remove the step, seeing as it wasn't being used in any meaningful way.
It should be fine to bring the 'confirm' step back in the future if we need it, we will just have to
make sure paypal the paypal issue is resolved.
This commit is contained in:
Rob Harrington
2017-09-23 12:33:45 +10:00
parent a09a54e4cb
commit 75ec77dc31
2 changed files with 13 additions and 1 deletions

View File

@@ -37,7 +37,8 @@ Spree::Order.class_eval do
end
order.payment_required?
}
go_to_state :confirm, :if => lambda { |order| order.confirmation_required? }
# NOTE: :confirm step was removed because we were not actually using it
# go_to_state :confirm, :if => lambda { |order| order.confirmation_required? }
go_to_state :complete
remove_transition :from => :delivery, :to => :confirm
end

View File

@@ -750,4 +750,15 @@ describe Spree::Order do
end
end
end
describe "determining checkout steps for an order" do
let!(:enterprise) { create(:enterprise) }
let!(:order) { create(:order, distributor: enterprise) }
let!(:payment_method) { create(:stripe_payment_method, distributor_ids: [enterprise.id], preferred_enterprise_id: enterprise.id) }
let!(:payment) { create(:payment, order: order, payment_method: payment_method) }
it "does not include the :confirm step" do
expect(order.checkout_steps).to_not include "confirm"
end
end
end