mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-27 04:51:14 +00:00
Merge pull request #51 from cblanc/return_steamid
Return steamid to users api
This commit is contained in:
commit
dae48f976d
2 changed files with 3 additions and 0 deletions
|
@ -15,6 +15,7 @@ class Api::V1::UsersController < Api::V1::BaseController
|
||||||
avatar: @user.profile.avatar.url,
|
avatar: @user.profile.avatar.url,
|
||||||
admin: @user.admin?,
|
admin: @user.admin?,
|
||||||
steam: {
|
steam: {
|
||||||
|
id: @user.steamid,
|
||||||
url: @steam.nil? ? nil : @steam.base_url,
|
url: @steam.nil? ? nil : @steam.base_url,
|
||||||
nickname: @steam.nil? ? nil : @steam.nickname
|
nickname: @steam.nil? ? nil : @steam.nickname
|
||||||
},
|
},
|
||||||
|
|
|
@ -20,6 +20,7 @@ describe Api::V1::UsersController do
|
||||||
expect(json["time_zone"]).to eq(@user.time_zone)
|
expect(json["time_zone"]).to eq(@user.time_zone)
|
||||||
expect(json["admin"]).to eq(@user.admin?)
|
expect(json["admin"]).to eq(@user.admin?)
|
||||||
expect(json).to have_key("steam")
|
expect(json).to have_key("steam")
|
||||||
|
expect(json["steam"]).to have_key("id")
|
||||||
expect(json["steam"]).to have_key("url")
|
expect(json["steam"]).to have_key("url")
|
||||||
expect(json["steam"]).to have_key("nickname")
|
expect(json["steam"]).to have_key("nickname")
|
||||||
expect(json["bans"]["mute"]).to eq(false)
|
expect(json["bans"]["mute"]).to eq(false)
|
||||||
|
@ -35,6 +36,7 @@ describe Api::V1::UsersController do
|
||||||
get :show, id: @user.id
|
get :show, id: @user.id
|
||||||
|
|
||||||
expect(response).to be_success
|
expect(response).to be_success
|
||||||
|
expect(json["steam"]["id"]).to_not be_nil
|
||||||
expect(json["steam"]["url"]).to be_nil
|
expect(json["steam"]["url"]).to be_nil
|
||||||
expect(json["steam"]["nickname"]).to be_nil
|
expect(json["steam"]["nickname"]).to be_nil
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue