diff options
author | James Lopez <james@jameslopez.es> | 2019-01-31 12:51:29 +0300 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2019-02-01 18:57:05 +0300 |
commit | c75687b51924a481dd05cf00f9fc28a3d8fd7735 (patch) | |
tree | 8c02130c6478742aa29b1ddcded4a67b05eb5cf0 /spec/services/members | |
parent | b49563c39fb6aaa610f7683f9bc2f76842a766b5 (diff) |
Update members service to cope with errors
Diffstat (limited to 'spec/services/members')
-rw-r--r-- | spec/services/members/create_service_spec.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/services/members/create_service_spec.rb b/spec/services/members/create_service_spec.rb index 5c01463d757..3bc05182932 100644 --- a/spec/services/members/create_service_spec.rb +++ b/spec/services/members/create_service_spec.rb @@ -36,4 +36,13 @@ describe Members::CreateService do expect(result[:message]).to be_present expect(project.users).not_to include project_user end + + it 'does not add an invalid member' do + params = { user_ids: project_user.id.to_s, access_level: -1 } + result = described_class.new(user, params).execute(project) + + expect(result[:status]).to eq(:error) + expect(result[:message]).to include(project_user.username) + expect(project.users).not_to include project_user + end end |