diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 12:55:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 12:55:51 +0300 |
commit | e8d2c2579383897a1dd7f9debd359abe8ae8373d (patch) | |
tree | c42be41678c2586d49a75cabce89322082698334 /spec/lib/gitlab/import_export/project/object_builder_spec.rb | |
parent | fc845b37ec3a90aaa719975f607740c22ba6a113 (diff) |
Add latest changes from gitlab-org/gitlab@14-1-stable-eev14.1.0-rc42
Diffstat (limited to 'spec/lib/gitlab/import_export/project/object_builder_spec.rb')
-rw-r--r-- | spec/lib/gitlab/import_export/project/object_builder_spec.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/lib/gitlab/import_export/project/object_builder_spec.rb b/spec/lib/gitlab/import_export/project/object_builder_spec.rb index 20d882c82be..4c9f9f7c690 100644 --- a/spec/lib/gitlab/import_export/project/object_builder_spec.rb +++ b/spec/lib/gitlab/import_export/project/object_builder_spec.rb @@ -150,4 +150,30 @@ RSpec.describe Gitlab::ImportExport::Project::ObjectBuilder do expect(merge_request.persisted?).to be true end end + + context 'merge request diff commit users' do + it 'finds the existing user' do + user = MergeRequest::DiffCommitUser + .find_or_create('Alice', 'alice@example.com') + + found = described_class.build( + MergeRequest::DiffCommitUser, + 'name' => 'Alice', + 'email' => 'alice@example.com' + ) + + expect(found).to eq(user) + end + + it 'creates a new user' do + found = described_class.build( + MergeRequest::DiffCommitUser, + 'name' => 'Alice', + 'email' => 'alice@example.com' + ) + + expect(found.name).to eq('Alice') + expect(found.email).to eq('alice@example.com') + end + end end |