diff options
author | Zeger-Jan van de Weg <zegerjan@gitlab.com> | 2016-03-11 00:08:11 +0300 |
---|---|---|
committer | Zeger-Jan van de Weg <zegerjan@gitlab.com> | 2016-03-13 21:08:04 +0300 |
commit | 42fcd3881fcece5c9bd4b720460d6cade573b151 (patch) | |
tree | acabaaa610da27413ffdd7b5a0dd1610d3772a4c /spec/requests/api/users_spec.rb | |
parent | 065de4ab791373f7e6b8b5d3b73b5fe7c9e8e7c5 (diff) |
External Users
The user has the rights of a public user execpt it can never create a project,
group, or team. Also it cant view internal projects.
Diffstat (limited to 'spec/requests/api/users_spec.rb')
-rw-r--r-- | spec/requests/api/users_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/requests/api/users_spec.rb b/spec/requests/api/users_spec.rb index 96e8c8c51f8..5366a7bd06b 100644 --- a/spec/requests/api/users_spec.rb +++ b/spec/requests/api/users_spec.rb @@ -120,6 +120,26 @@ describe API::API, api: true do expect(response.status).to eq(201) end + it 'creates non-external users by default' do + post api("/users", admin), attributes_for(:user) + expect(response.status).to eq(201) + + user_id = json_response['id'] + new_user = User.find(user_id) + expect(new_user).not_to eq nil + expect(new_user.external).to be_falsy + end + + it 'should allow an external user to be created' do + post api("/users", admin), attributes_for(:user, external: true) + expect(response.status).to eq(201) + + user_id = json_response['id'] + new_user = User.find(user_id) + expect(new_user).not_to eq nil + expect(new_user.external).to be_truthy + end + it "should not create user with invalid email" do post api('/users', admin), email: 'invalid email', |