diff --git a/config/routes.rb b/config/routes.rb index 5a5441f3b3..ba182c9607 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -54,13 +54,6 @@ Openfoodnetwork::Application.routes.draw do end end - # used for payments_controller_spec.rb - resources :payments do - member do - get :redirect_to_authorize - end - end - resources :line_items, only: [:destroy] do get :bought, on: :collection end diff --git a/spec/controllers/payments_controller_spec.rb b/spec/controllers/payments_controller_spec.rb index a1e919ee88..f678e7de86 100644 --- a/spec/controllers/payments_controller_spec.rb +++ b/spec/controllers/payments_controller_spec.rb @@ -9,7 +9,7 @@ describe "/payments/redirect_to_authorize", type: :request do describe "when user isn't logged in" do it "redirects to the login page and set error flash msg" do - get redirect_to_authorize_payment_path(payment) + get authorize_payment_path(payment) expect(response).to redirect_to(root_path(anchor: "/login", after_login: request.fullpath)) expect(flash[:error]).to eq I18n.t("spree.orders.edit.login_to_view_order") end @@ -24,14 +24,14 @@ describe "/payments/redirect_to_authorize", type: :request do end it "redirects to the CVV response URL" do - get redirect_to_authorize_payment_path(payment) + get authorize_payment_path(payment) expect(response).to redirect_to('http://example.com') end end context "doesn't have cvv response message" do it "redirect to order URL" do - get redirect_to_authorize_payment_path(payment) + get authorize_payment_path(payment) expect(response).to redirect_to(order_url(order)) end end