mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-26 01:33:22 +00:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user