Fix Grape tests.
This commit is contained in:
parent
c53b599e61
commit
4efc4f5b31
|
@ -398,9 +398,9 @@ describe API::API, api: true do
|
||||||
end.to change{ user.keys.count }.by(1)
|
end.to change{ user.keys.count }.by(1)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "returns 405 for invalid ID" do
|
it "returns 400 for invalid ID" do
|
||||||
post api("/users/ASDF/keys", admin)
|
post api("/users/999999/keys", admin)
|
||||||
expect(response).to have_http_status(405)
|
expect(response).to have_http_status(400)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -429,11 +429,6 @@ describe API::API, api: true do
|
||||||
expect(json_response).to be_an Array
|
expect(json_response).to be_an Array
|
||||||
expect(json_response.first['title']).to eq(key.title)
|
expect(json_response.first['title']).to eq(key.title)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "returns 405 for invalid ID" do
|
|
||||||
get api("/users/ASDF/keys", admin)
|
|
||||||
expect(response).to have_http_status(405)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -490,8 +485,8 @@ describe API::API, api: true do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "raises error for invalid ID" do
|
it "raises error for invalid ID" do
|
||||||
post api("/users/ASDF/emails", admin)
|
post api("/users/999999/emails", admin)
|
||||||
expect(response).to have_http_status(405)
|
expect(response).to have_http_status(400)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue