diff options
author | Liam McAndrew <lmcandrew@gitlab.com> | 2019-05-28 13:31:51 +0300 |
---|---|---|
committer | James Lopez <james@gitlab.com> | 2019-05-28 13:31:51 +0300 |
commit | 5ddb32f3820a16294948fad34095eb4b009597ba (patch) | |
tree | fa2a0767441d9fe1249e760bf0df3c8c04d87475 /spec/lib | |
parent | 5fd4415537dec9b795608b2c4e90a04f31106f88 (diff) |
Fix order dependency with user params during imports
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/gitlab/import_export/members_mapper_spec.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/spec/lib/gitlab/import_export/members_mapper_spec.rb b/spec/lib/gitlab/import_export/members_mapper_spec.rb index c663cf42a83..b95b5dfe791 100644 --- a/spec/lib/gitlab/import_export/members_mapper_spec.rb +++ b/spec/lib/gitlab/import_export/members_mapper_spec.rb @@ -12,7 +12,6 @@ describe Gitlab::ImportExport::MembersMapper do "access_level" => 40, "source_id" => 14, "source_type" => "Project", - "user_id" => 19, "notification_level" => 3, "created_at" => "2016-03-11T10:21:44.822Z", "updated_at" => "2016-03-11T10:21:44.822Z", @@ -25,7 +24,8 @@ describe Gitlab::ImportExport::MembersMapper do "id" => exported_user_id, "email" => user2.email, "username" => 'test' - } + }, + "user_id" => 19 }, { "id" => 3, @@ -80,6 +80,15 @@ describe Gitlab::ImportExport::MembersMapper do expect(ProjectMember.find_by_user_id(user2.id).access_level).to eq(ProjectMember::MAINTAINER) end + it 'removes old user_id from member_hash to avoid conflict with user key' do + expect(ProjectMember).to receive(:create) + .twice + .with(hash_excluding('user_id')) + .and_call_original + + members_mapper.map + end + context 'user is not an admin' do let(:user) { create(:user) } |