diff options
author | George Koltsov <gkoltsov@gitlab.com> | 2019-07-17 12:16:54 +0100 |
---|---|---|
committer | George Koltsov <gkoltsov@gitlab.com> | 2019-07-17 12:16:54 +0100 |
commit | 0bd54eb43626c008a36958e42019f0dfea794dde (patch) | |
tree | ca700580e436e16d4e935ebb2e59c3d723737913 | |
parent | 8e6af8c59ff1d22bc32e3d2ef44da5399bc23727 (diff) | |
download | gitlab-ce-0bd54eb43626c008a36958e42019f0dfea794dde.tar.gz |
Add MembersMapper#ensure_default_user! spec
-rw-r--r-- | spec/lib/gitlab/import_export/members_mapper_spec.rb | 10 |
1 files changed, 10 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 b95b5dfe791..a9e8431acba 100644 --- a/spec/lib/gitlab/import_export/members_mapper_spec.rb +++ b/spec/lib/gitlab/import_export/members_mapper_spec.rb @@ -154,5 +154,15 @@ describe Gitlab::ImportExport::MembersMapper do expect(members_mapper.map[exported_user_id]).to eq(user2.id) end end + + context 'when importer mapping fails' do + let(:exception_message) { 'Something went wrong' } + + it 'includes importer specific error message' do + expect(ProjectMember).to receive(:create!).and_raise(StandardError.new(exception_message)) + + expect { members_mapper.map }.to raise_error(StandardError, "Error adding importer user to project members. #{exception_message}") + end + end end end |