summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-12-12 22:02:05 -0800
committerStan Hu <stanhu@gmail.com>2015-12-24 07:57:13 -0800
commit5a8c65b508614dd8896ff8af7cad6e2b33fb7244 (patch)
treec0b86bbbbc15b74829ba2e97d8b3014d42b4bb9c /spec
parent1a23af485cd755738f4051e04132b1eb93fc3fab (diff)
downloadgitlab-ce-5a8c65b508614dd8896ff8af7cad6e2b33fb7244.tar.gz
Add API support for looking up a user by username
Needed to support Huboard
Diffstat (limited to 'spec')
-rw-r--r--spec/requests/api/users_spec.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/requests/api/users_spec.rb b/spec/requests/api/users_spec.rb
index 2f609c63330..4f278551d07 100644
--- a/spec/requests/api/users_spec.rb
+++ b/spec/requests/api/users_spec.rb
@@ -27,6 +27,13 @@ describe API::API, api: true do
user['username'] == username
end['username']).to eq(username)
end
+
+ it "should return one user" do
+ get api("/users?username=#{omniauth_user.username}", user)
+ expect(response.status).to eq(200)
+ expect(json_response).to be_an Array
+ expect(json_response.first['username']).to eq(omniauth_user.username)
+ end
end
context "when admin" do