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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-07-28 03:10:23 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-07-28 03:10:23 +0300
commitd5e36a9bb7bf1e928d6ea2bc7a65bbb77a6c5527 (patch)
treecae359af6956c6ff7ae1b47e7fca3ab66688221a /spec/lib/banzai/pipeline
parent3bb92fbffddccedec5f03b4ea31c025ef745c345 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/banzai/pipeline')
-rw-r--r--spec/lib/banzai/pipeline/gfm_pipeline_spec.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/lib/banzai/pipeline/gfm_pipeline_spec.rb b/spec/lib/banzai/pipeline/gfm_pipeline_spec.rb
index 247f4591632..beb760637b0 100644
--- a/spec/lib/banzai/pipeline/gfm_pipeline_spec.rb
+++ b/spec/lib/banzai/pipeline/gfm_pipeline_spec.rb
@@ -30,6 +30,34 @@ RSpec.describe Banzai::Pipeline::GfmPipeline do
described_class.call(markdown, project: project)
end
+ context "with update_nodes_for_banzai_reference_filter feature flag disabled" do
+ before do
+ stub_feature_flags(update_nodes_for_banzai_reference_filter: false)
+ end
+
+ context 'when shorthand pattern #ISSUE_ID is used' do
+ it 'links an internal issues and doesnt store nodes in result[:reference_filter_nodes]', :aggregate_failures do
+ issue = create(:issue, project: project)
+ markdown = "text #{issue.to_reference(project, full: true)}"
+ result = described_class.call(markdown, project: project)
+ link = result[:output].css('a').first
+
+ expect(link['href']).to eq(Gitlab::Routing.url_helpers.project_issue_path(project, issue))
+ expect(result[:reference_filter_nodes]).to eq nil
+ end
+ end
+
+ it 'execute :each_node for each reference_filter', :aggregate_failures do
+ issue = create(:issue, project: project)
+ markdown = "text #{issue.to_reference(project, full: true)}"
+ described_class.reference_filters do |reference_filter|
+ expect_any_instance_of(reference_filter).to receive(:each_node).once
+ end
+
+ described_class.call(markdown, project: project)
+ end
+ end
+
context 'when shorthand pattern #ISSUE_ID is used' do
it 'links an internal issue if it exists' do
issue = create(:issue, project: project)