From 4d37aaac640ade4ab1043914e75ecd1cf6d8d131 Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Thu, 19 Sep 2019 10:52:00 +0100 Subject: [PATCH] Use have_http_status and remove check for error message, that's something for the base_controller test to test --- spec/controllers/api/orders_controller_spec.rb | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/spec/controllers/api/orders_controller_spec.rb b/spec/controllers/api/orders_controller_spec.rb index 8eb80d3aa3..7786536635 100644 --- a/spec/controllers/api/orders_controller_spec.rb +++ b/spec/controllers/api/orders_controller_spec.rb @@ -166,17 +166,12 @@ module Api it "when no order number is given" do get :show, id: nil - expect_resource_not_found + expect(response).to have_http_status(:not_found) end it "when order number given is not in the systen" do get :show, id: "X1321313232" - expect_resource_not_found - end - - def expect_resource_not_found - expect(json_response).to eq( "error" => "The resource you were looking for could not be found." ) - expect(response.status).to eq(404) + expect(response).to have_http_status(:not_found) end end