diff options
author | Robert Speicher <robert@gitlab.com> | 2016-09-12 23:08:33 +0300 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2016-09-12 23:08:33 +0300 |
commit | c87235a24d144689f97cc52b8039f24f63a86bbf (patch) | |
tree | d19e476328c4501905af0ffbd19501a1d44f2e7b /spec/lib/gitlab/github_import | |
parent | 3de4e8b589475b941ba8377ec88e28ab1a041169 (diff) | |
parent | 4a788f8a0c7a7b72d77afc3965f1656def2a0ac2 (diff) |
Merge branch '21569-dont-add-created-by-for-matched-users' into 'master'
Only add original author tag line when importing from GitHub if there isn't a linked GitLab account
## What does this MR do?
If there we've found a linked GitLab user for a creator of an issue or comment don't add the 'Created By:' line.
## What are the relevant issue numbers?
Closes #21569
See merge request !6081
Diffstat (limited to 'spec/lib/gitlab/github_import')
3 files changed, 18 insertions, 0 deletions
diff --git a/spec/lib/gitlab/github_import/comment_formatter_spec.rb b/spec/lib/gitlab/github_import/comment_formatter_spec.rb index 9ae02a6c45f..c520a9c53ad 100644 --- a/spec/lib/gitlab/github_import/comment_formatter_spec.rb +++ b/spec/lib/gitlab/github_import/comment_formatter_spec.rb @@ -73,6 +73,12 @@ describe Gitlab::GithubImport::CommentFormatter, lib: true do gl_user = create(:omniauth_user, extern_uid: octocat.id, provider: 'github') expect(comment.attributes.fetch(:author_id)).to eq gl_user.id end + + it 'returns note without created at tag line' do + create(:omniauth_user, extern_uid: octocat.id, provider: 'github') + + expect(comment.attributes.fetch(:note)).to eq("I'm having a problem with this.") + end end end end diff --git a/spec/lib/gitlab/github_import/issue_formatter_spec.rb b/spec/lib/gitlab/github_import/issue_formatter_spec.rb index d60c4111e99..c2f1f6b91a1 100644 --- a/spec/lib/gitlab/github_import/issue_formatter_spec.rb +++ b/spec/lib/gitlab/github_import/issue_formatter_spec.rb @@ -109,6 +109,12 @@ describe Gitlab::GithubImport::IssueFormatter, lib: true do expect(issue.attributes.fetch(:author_id)).to eq gl_user.id end + + it 'returns description without created at tag line' do + create(:omniauth_user, extern_uid: octocat.id, provider: 'github') + + expect(issue.attributes.fetch(:description)).to eq("I'm having a problem with this.") + end end end diff --git a/spec/lib/gitlab/github_import/pull_request_formatter_spec.rb b/spec/lib/gitlab/github_import/pull_request_formatter_spec.rb index edfc6ad81c6..302f0fc0623 100644 --- a/spec/lib/gitlab/github_import/pull_request_formatter_spec.rb +++ b/spec/lib/gitlab/github_import/pull_request_formatter_spec.rb @@ -140,6 +140,12 @@ describe Gitlab::GithubImport::PullRequestFormatter, lib: true do expect(pull_request.attributes.fetch(:author_id)).to eq gl_user.id end + + it 'returns description without created at tag line' do + create(:omniauth_user, extern_uid: octocat.id, provider: 'github') + + expect(pull_request.attributes.fetch(:description)).to eq('Please pull these awesome changes') + end end context 'when it has a milestone' do |