summaryrefslogtreecommitdiff
path: root/spec/finders
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-10-02 11:42:57 +0000
committerRobert Speicher <robert@gitlab.com>2016-10-02 11:42:57 +0000
commite64594ac4419a42b84f3ee36388f832e74361c8c (patch)
tree13168c00d7e0b8dadb30d28318b803f92b9e30fe /spec/finders
parent076e0406390cb03ade887723bceb3a6bb9613986 (diff)
parent60790cac6b3a13e0b33f37d896146539fddcb7e6 (diff)
downloadgitlab-ce-e64594ac4419a42b84f3ee36388f832e74361c8c.tar.gz
Merge branch '21983-member-add_user-doesn-t-detect-existing-members-that-have-requested-access' into 'master'
Resolve "`Member.add_user`doesn't detect existing members that have requested access" ## What does this MR do? This merge request handle the case when an access requester is added to a group or project (via the members page or the API). In `Member.add_user`, if an access requester already exists, we simply accept their request (and set the `created_by`, `access_level` and `expires_at` attributes if given). ## Are there points in the code the reviewer needs to double check? I've taken the opportunity to cleanup the whole `{Group,Project}Member.add_user*` methods since it was quite a mess. ## What are the relevant issue numbers? Closes #21983 See merge request !6393
Diffstat (limited to 'spec/finders')
-rw-r--r--spec/finders/joined_groups_finder_spec.rb2
-rw-r--r--spec/finders/projects_finder_spec.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/spec/finders/joined_groups_finder_spec.rb b/spec/finders/joined_groups_finder_spec.rb
index f90a8e007c8..29a47e005a6 100644
--- a/spec/finders/joined_groups_finder_spec.rb
+++ b/spec/finders/joined_groups_finder_spec.rb
@@ -43,7 +43,7 @@ describe JoinedGroupsFinder do
context 'if profile visitor is in one of the private group projects' do
before do
project = create(:project, :private, group: private_group, name: 'B', path: 'B')
- project.team.add_user(profile_visitor, Gitlab::Access::DEVELOPER)
+ project.add_user(profile_visitor, Gitlab::Access::DEVELOPER)
end
it 'shows group' do
diff --git a/spec/finders/projects_finder_spec.rb b/spec/finders/projects_finder_spec.rb
index 7a3a74335e8..13bda5f7c5a 100644
--- a/spec/finders/projects_finder_spec.rb
+++ b/spec/finders/projects_finder_spec.rb
@@ -38,7 +38,7 @@ describe ProjectsFinder do
describe 'with private projects' do
before do
- private_project.team.add_user(user, Gitlab::Access::MASTER)
+ private_project.add_user(user, Gitlab::Access::MASTER)
end
it do