mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-11-14 08:50:44 +00:00
Return error in JSON for users API
This commit is contained in:
parent
56087b09f3
commit
8717173797
2 changed files with 3 additions and 1 deletions
|
@ -51,7 +51,7 @@ class Api::V1::UsersController < Api::V1::BaseController
|
|||
private
|
||||
|
||||
def not_found
|
||||
head :not_found
|
||||
render json: {error: "User not found"}, status: :not_found
|
||||
end
|
||||
|
||||
def steam_profile(user)
|
||||
|
|
|
@ -80,11 +80,13 @@ describe Api::V1::UsersController do
|
|||
it "returns 404 if user does not exist" do
|
||||
get :show, id: -1
|
||||
expect(response.status).to eq(404)
|
||||
expect(json["error"]).to eq("User not found")
|
||||
end
|
||||
|
||||
it "returns 404 if user does not exist by steamid" do
|
||||
get :show, id: -1, format: "steamid"
|
||||
expect(response.status).to eq(404)
|
||||
expect(json["error"]).to eq("User not found")
|
||||
end
|
||||
|
||||
it "queries the steam condenser for an invalid steamid" do
|
||||
|
|
Loading…
Reference in a new issue