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-02-25 15:49:42 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-03-03 12:41:11 +0300
commita472c1bfd0b5c09e2c9b9da5ff0de3c90aaeda2f (patch)
tree78d222497df7be5d652e96e85779abbb75bc9bfb /spec/lib/banzai/filter/label_reference_filter_spec.rb
parentdbc7bf7fe14249fdc1168c84bdfaad07bfbbbec0 (diff)
Add support for cross project references for labels
Diffstat (limited to 'spec/lib/banzai/filter/label_reference_filter_spec.rb')
-rw-r--r--spec/lib/banzai/filter/label_reference_filter_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/lib/banzai/filter/label_reference_filter_spec.rb b/spec/lib/banzai/filter/label_reference_filter_spec.rb
index 9d9e5cbac3d..96a403f2694 100644
--- a/spec/lib/banzai/filter/label_reference_filter_spec.rb
+++ b/spec/lib/banzai/filter/label_reference_filter_spec.rb
@@ -176,4 +176,23 @@ describe Banzai::Filter::LabelReferenceFilter, lib: true do
expect(result[:references][:label]).to eq [label]
end
end
+
+ describe 'cross project label references' do
+ let(:another_project) { create(:empty_project, :public) }
+ let(:label) { create(:label, project: another_project, color: '#00ff00') }
+ let(:reference) { label.to_reference(project) }
+
+ let!(:result) { reference_filter("See #{reference}") }
+
+ it 'points to referenced project issues page' do
+ expect(result.css('a').first.attr('href'))
+ .to eq urls.namespace_project_issues_url(another_project.namespace,
+ another_project,
+ label_name: label.name)
+ end
+
+ it 'has valid color' do
+ expect(result.css('a span').first.attr('style')).to match /background-color: #00ff00/
+ end
+ end
end