mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-11-15 09:21:25 +00:00
Merge pull request #51 from cblanc/return_steamid
Return steamid to users api
This commit is contained in:
commit
2d7ba6cf9c
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,
|
||||
admin: @user.admin?,
|
||||
steam: {
|
||||
id: @user.steamid,
|
||||
url: @steam.nil? ? nil : @steam.base_url,
|
||||
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["admin"]).to eq(@user.admin?)
|
||||
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("nickname")
|
||||
expect(json["bans"]["mute"]).to eq(false)
|
||||
|
@ -35,6 +36,7 @@ describe Api::V1::UsersController do
|
|||
get :show, id: @user.id
|
||||
|
||||
expect(response).to be_success
|
||||
expect(json["steam"]["id"]).to_not be_nil
|
||||
expect(json["steam"]["url"]).to be_nil
|
||||
expect(json["steam"]["nickname"]).to be_nil
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue