Merge pull request #51 from cblanc/return_steamid

Return steamid to users api
This commit is contained in:
Luke Barratt 2015-08-31 16:19:50 +01:00
commit dae48f976d
2 changed files with 3 additions and 0 deletions

View file

@ -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
},

View file

@ -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