summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-08-08 16:38:50 +0000
committerRémy Coutable <remy@rymai.me>2016-08-08 16:38:50 +0000
commit59ce1af53b8d25d1b4ae8b6e59f069c5147ca572 (patch)
tree8ed2415778c4ea1b0f546e0c04c3b7bf6cda0c96 /spec
parentfd3a2cf76318a84dc6d3bab9bd9a767c5112106d (diff)
parentf04e9dad476cb6b2ac338dd8730d79b22f3fd070 (diff)
downloadgitlab-ce-59ce1af53b8d25d1b4ae8b6e59f069c5147ca572.tar.gz
Merge branch 'fix/import-pending-user' into 'master'
Support pending invitation project members importing projects Adds support for pending invitation project members on Import/Export - previously the import would fail. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/19973 - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - Tests - [x] Added for this feature/bug - [x] All builds are passing - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !5683
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/import_export/members_mapper_spec.rb20
1 files changed, 20 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 6d5aa0d04a2..770e8b0c2f4 100644
--- a/spec/lib/gitlab/import_export/members_mapper_spec.rb
+++ b/spec/lib/gitlab/import_export/members_mapper_spec.rb
@@ -26,6 +26,20 @@ describe Gitlab::ImportExport::MembersMapper, services: true do
"email" => user2.email,
"username" => user2.username
}
+ },
+ {
+ "id" => 3,
+ "access_level" => 40,
+ "source_id" => 14,
+ "source_type" => "Project",
+ "user_id" => nil,
+ "notification_level" => 3,
+ "created_at" => "2016-03-11T10:21:44.822Z",
+ "updated_at" => "2016-03-11T10:21:44.822Z",
+ "created_by_id" => 1,
+ "invite_email" => 'invite@test.com',
+ "invite_token" => 'token',
+ "invite_accepted_at" => nil
}]
end
@@ -47,5 +61,11 @@ describe Gitlab::ImportExport::MembersMapper, services: true do
expect(members_mapper.missing_author_ids.first).to eq(-1)
end
+
+ it 'has invited members with no user' do
+ members_mapper.map
+
+ expect(ProjectMember.find_by_invite_email('invite@test.com')).not_to be_nil
+ end
end
end