summaryrefslogtreecommitdiff
path: root/spec/factories
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/factories
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/factories')
-rw-r--r--spec/factories/project_members.rb23
1 files changed, 4 insertions, 19 deletions
diff --git a/spec/factories/project_members.rb b/spec/factories/project_members.rb
index cf3659ba275..1ddb305a8af 100644
--- a/spec/factories/project_members.rb
+++ b/spec/factories/project_members.rb
@@ -4,24 +4,9 @@ FactoryGirl.define do
project
master
- trait :guest do
- access_level ProjectMember::GUEST
- end
-
- trait :reporter do
- access_level ProjectMember::REPORTER
- end
-
- trait :developer do
- access_level ProjectMember::DEVELOPER
- end
-
- trait :master do
- access_level ProjectMember::MASTER
- end
-
- trait :owner do
- access_level ProjectMember::OWNER
- end
+ trait(:guest) { access_level ProjectMember::GUEST }
+ trait(:reporter) { access_level ProjectMember::REPORTER }
+ trait(:developer) { access_level ProjectMember::DEVELOPER }
+ trait(:master) { access_level ProjectMember::MASTER }
end
end