diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /spec/lib/gitlab/gfm/reference_rewriter_spec.rb | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'spec/lib/gitlab/gfm/reference_rewriter_spec.rb')
-rw-r--r-- | spec/lib/gitlab/gfm/reference_rewriter_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/lib/gitlab/gfm/reference_rewriter_spec.rb b/spec/lib/gitlab/gfm/reference_rewriter_spec.rb index 1c9004262c5..f4875aa0ebc 100644 --- a/spec/lib/gitlab/gfm/reference_rewriter_spec.rb +++ b/spec/lib/gitlab/gfm/reference_rewriter_spec.rb @@ -110,6 +110,20 @@ RSpec.describe Gitlab::Gfm::ReferenceRewriter do end end + context 'when description contains a local reference' do + let(:local_issue) { create(:issue, project: old_project) } + let(:text) { "See ##{local_issue.iid}" } + + it { is_expected.to eq("See #{old_project.path}##{local_issue.iid}") } + end + + context 'when description contains a cross reference' do + let(:merge_request) { create(:merge_request) } + let(:text) { "See #{merge_request.project.full_path}!#{merge_request.iid}" } + + it { is_expected.to eq(text) } + end + context 'with a commit' do let(:old_project) { create(:project, :repository, name: 'old-project', group: group) } let(:commit) { old_project.commit } |