summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorJames Lopez <james@gitlab.com>2019-05-23 13:10:38 +0000
committerJan Provaznik <jprovaznik@gitlab.com>2019-05-23 13:10:38 +0000
commit30d915110f94c75b464e1cee5e51a16fbd72fabd (patch)
tree647daa7788875bea3abf63439b940e8e736f946c /spec
parentbd1ef521732715310dedb2cb2071a589432444ea (diff)
downloadgitlab-ce-30d915110f94c75b464e1cee5e51a16fbd72fabd.tar.gz
Fix issue importing members with owner access
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/import_export/members_mapper_spec.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/lib/gitlab/import_export/members_mapper_spec.rb b/spec/lib/gitlab/import_export/members_mapper_spec.rb
index 67e4c289906..c663cf42a83 100644
--- a/spec/lib/gitlab/import_export/members_mapper_spec.rb
+++ b/spec/lib/gitlab/import_export/members_mapper_spec.rb
@@ -73,6 +73,13 @@ describe Gitlab::ImportExport::MembersMapper do
expect(user2.authorized_project?(project)).to be true
end
+ it 'maps an owner as a maintainer' do
+ exported_members.first['access_level'] = ProjectMember::OWNER
+
+ expect(members_mapper.map[exported_user_id]).to eq(user2.id)
+ expect(ProjectMember.find_by_user_id(user2.id).access_level).to eq(ProjectMember::MAINTAINER)
+ end
+
context 'user is not an admin' do
let(:user) { create(:user) }