Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/controllers/boutique/orders_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ def confirm
end
end

def get_confirm
redirect_to action: :edit
end

def show
@use_boutique_adaptive_css = :no_background
end
Expand Down
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
get :crossdomain_add, path: "crossdomain_add/:product_variant_slug"
post :add
post :confirm
get :get_confirm, to: :get_confirm, path: "/confirm"
post :apply_voucher
post :payment, path: "/:id/payment"
end
Expand Down
9 changes: 9 additions & 0 deletions test/controllers/boutique/orders_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,15 @@ class Boutique::OrdersControllerTest < Boutique::ControllerTest
assert @order.primary_address.present?
end

test "get_confirm" do
get confirm_order_url
assert_redirected_to main_app.root_url

create_order_with_current_session_id
get confirm_order_url
assert_redirected_to edit_order_url
end

test "show" do
order = create(:boutique_order, :ready_to_be_confirmed)
assert_raises(ActiveRecord::RecordNotFound) { get order_url(order.secret_hash) }
Expand Down