Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-03-20 12:52:01 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-03-20 12:52:01 +0300
commit6eb31056346ed07db4f66e4ba2369ff9779230c5 (patch)
tree073c60878f25ea26b8b5b61c6820434cb0f45a70 /spec/lib/gitlab/gfm
parent323d328c8644e3ff01b806f7754d33c0c7dedd7b (diff)
Find referable for each ref found in references rewriter
Diffstat (limited to 'spec/lib/gitlab/gfm')
-rw-r--r--spec/lib/gitlab/gfm/reference_rewriter_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/lib/gitlab/gfm/reference_rewriter_spec.rb b/spec/lib/gitlab/gfm/reference_rewriter_spec.rb
index db7bee110af..0a7ca3ec848 100644
--- a/spec/lib/gitlab/gfm/reference_rewriter_spec.rb
+++ b/spec/lib/gitlab/gfm/reference_rewriter_spec.rb
@@ -61,6 +61,21 @@ describe Gitlab::Gfm::ReferenceRewriter do
it { is_expected.to eq "#{ref}, `#1`, #{ref}, `#1`" }
end
+
+ context 'description with labels' do
+ let!(:label) { create(:label, id: 123, name: 'test', project: old_project) }
+ let(:project_ref) { old_project.to_reference }
+
+ context 'label referenced by id' do
+ let(:text) { '#1 and ~123' }
+ it { is_expected.to eq %Q{#{project_ref}#1 and #{project_ref}~123} }
+ end
+
+ context 'label referenced by text' do
+ let(:text) { '#1 and ~"test"' }
+ it { is_expected.to eq %Q{#{project_ref}#1 and #{project_ref}~123} }
+ end
+ end
end
context 'reference contains milestone' do