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:
Diffstat (limited to 'spec/lib/banzai/filter/commit_reference_filter_spec.rb')
-rw-r--r--spec/lib/banzai/filter/commit_reference_filter_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/lib/banzai/filter/commit_reference_filter_spec.rb b/spec/lib/banzai/filter/commit_reference_filter_spec.rb
index b18af806118..d6c9e9e4b19 100644
--- a/spec/lib/banzai/filter/commit_reference_filter_spec.rb
+++ b/spec/lib/banzai/filter/commit_reference_filter_spec.rb
@@ -238,4 +238,20 @@ describe Banzai::Filter::CommitReferenceFilter do
expect(doc.text).to eq("See (#{commit.reference_link_text(project)} (builds).patch)")
end
end
+
+ context 'group context' do
+ let(:context) { { project: nil, group: create(:group) } }
+
+ it 'ignores internal references' do
+ exp = act = "See #{commit.id}"
+
+ expect(reference_filter(act, context).to_html).to eq exp
+ end
+
+ it 'links to a valid reference' do
+ act = "See #{project.full_path}@#{commit.id}"
+
+ expect(reference_filter(act, context).css('a').first.text).to eql("#{project.full_path}@#{commit.short_id}")
+ end
+ end
end