Use have_http_status and remove check for error message, that's something for the base_controller test to test

This commit is contained in:
luisramos0
2019-09-19 10:52:00 +01:00
parent 19e28cb14a
commit 4d37aaac64

View File

@@ -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