mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-26 12:30:48 +00:00
Add new user API spec
This commit is contained in:
parent
ddb6467573
commit
429939cf6a
1 changed files with 17 additions and 3 deletions
|
@ -78,9 +78,23 @@ describe Api::V1::UsersController do
|
|||
end
|
||||
|
||||
it "returns 404 if user does not exist" do
|
||||
expect {
|
||||
get :show, id: -1
|
||||
}.to raise_error(ActionController::RoutingError)
|
||||
expect { get :show, id: -1 }.to raise_error(ActionController::RoutingError)
|
||||
end
|
||||
|
||||
it "returns 404 if user does not exist by steamid" do
|
||||
expect { get :show, id: -1, format: "steamid" }.to raise_error(ActionController::RoutingError)
|
||||
end
|
||||
|
||||
it "queries the steam condenser for an invalid steamid" do
|
||||
@user.update_attribute(:steamid, "0:0:0")
|
||||
|
||||
get :show, id: @user.id
|
||||
|
||||
expect(response).to be_success
|
||||
expect(json["steam"]).to_not be_nil
|
||||
expect(json["steam"]["id"]).to eq(@user.steamid)
|
||||
expect(json["steam"]["url"]).to be_nil
|
||||
expect(json["steam"]["nickname"]).to be_nil
|
||||
end
|
||||
|
||||
it "returns correct ban if user muted" do
|
||||
|
|
Loading…
Reference in a new issue