From 0784b8263ae1d3438a9170ba28c6afd53507f691 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Mon, 2 Mar 2020 19:22:43 +0100 Subject: [PATCH] Fix spec setup in api/orders_controller_spec ActionController doesn't accept nil values for :id as a valid route request in Rails 4. Fixes: 2) Api::OrdersController#show Resource not found when no order number is given Failure/Error: get :show, id: nil ActionController::UrlGenerationError: No route matches {:action=>"show", :controller=>"api/orders", :id=>nil} # ./spec/controllers/api/orders_controller_spec.rb:168:in `block (4 levels) in ' --- spec/controllers/api/orders_controller_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/controllers/api/orders_controller_spec.rb b/spec/controllers/api/orders_controller_spec.rb index 5e463fe7a2..69438ec2da 100644 --- a/spec/controllers/api/orders_controller_spec.rb +++ b/spec/controllers/api/orders_controller_spec.rb @@ -165,7 +165,7 @@ module Api before { allow(controller).to receive(:spree_current_user) { admin_user } } it "when no order number is given" do - get :show, id: nil + get :show, id: "" expect(response).to have_http_status(:not_found) end