diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-08-07 00:20:02 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-08-07 00:20:02 -0400 |
commit | fb6dc1f07de124915e48456bf45c108878687043 (patch) | |
tree | 3b086430eed3f4f88fc2ca6eb77a9476b841ede4 /spec/models | |
parent | 5fb5fd253a960ed33eebc0f6aabeae37aa175fa8 (diff) | |
download | gitlab-ce-fb6dc1f07de124915e48456bf45c108878687043.tar.gz |
Add `Group#add_*` convenience methodsrs-group-convenience-methods
Encapsulates the logic for `Gitlab::Access::WHATEVER` levels.
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/hooks/system_hook_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/project_team_spec.rb | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/spec/models/hooks/system_hook_spec.rb b/spec/models/hooks/system_hook_spec.rb index 4175f9dd88f..02d2cc2c77a 100644 --- a/spec/models/hooks/system_hook_spec.rb +++ b/spec/models/hooks/system_hook_spec.rb @@ -101,7 +101,7 @@ describe SystemHook do it 'group member create hook' do group = create(:group) user = create(:user) - group.add_user(user, Gitlab::Access::MASTER) + group.add_master(user) expect(WebMock).to have_requested(:post, @system_hook.url).with( body: /user_add_to_group/, headers: { 'Content-Type'=>'application/json', 'X-Gitlab-Event'=>'System Hook' } @@ -111,7 +111,7 @@ describe SystemHook do it 'group member destroy hook' do group = create(:group) user = create(:user) - group.add_user(user, Gitlab::Access::MASTER) + group.add_master(user) group.group_members.destroy_all expect(WebMock).to have_requested(:post, @system_hook.url).with( body: /user_remove_from_group/, diff --git a/spec/models/project_team_spec.rb b/spec/models/project_team_spec.rb index d125166e336..cc1138490a0 100644 --- a/spec/models/project_team_spec.rb +++ b/spec/models/project_team_spec.rb @@ -37,9 +37,9 @@ describe ProjectTeam do let(:project) { create(:empty_project, group: group) } before do - group.add_user(master, Gitlab::Access::MASTER) - group.add_user(reporter, Gitlab::Access::REPORTER) - group.add_user(guest, Gitlab::Access::GUEST) + group.add_master(master) + group.add_reporter(reporter) + group.add_guest(guest) # If user is a group and a project member - GitLab uses highest permission # So we add group guest as master and add group master as guest |