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:
authorGabriel Mazetto <gabriel@gitlab.com>2016-04-07 02:09:15 +0300
committerGabriel Mazetto <gabriel@gitlab.com>2016-04-07 02:09:15 +0300
commit1575a95b65d4cad91f775ae260b8828cdf303462 (patch)
tree6aedda10b0a398c3cf403a601dfb28da80fc3272
parent207b7218aa4394dc24c68041eade04474ff41537 (diff)
little refactor and improvements on specs
-rw-r--r--lib/banzai/filter/gollum_tags_filter.rb8
-rw-r--r--spec/lib/banzai/filter/gollum_tags_filter_spec.rb2
-rw-r--r--spec/lib/banzai/pipeline/wiki_pipeline_spec.rb9
3 files changed, 6 insertions, 13 deletions
diff --git a/lib/banzai/filter/gollum_tags_filter.rb b/lib/banzai/filter/gollum_tags_filter.rb
index f710a4971b0..d08267a9d6c 100644
--- a/lib/banzai/filter/gollum_tags_filter.rb
+++ b/lib/banzai/filter/gollum_tags_filter.rb
@@ -118,7 +118,7 @@ module Banzai
end
if path
- content_tag(:img, nil, src: path, class: tag_class('image'))
+ content_tag(:img, nil, src: path, class: 'gfm')
end
end
@@ -155,7 +155,7 @@ module Banzai
href = ::File.join(project_wiki_base_path, reference)
end
- content_tag(:a, name || reference, href: href, class: tag_class('page'))
+ content_tag(:a, name || reference, href: href, class: 'gfm')
end
def project_wiki
@@ -172,10 +172,6 @@ module Banzai
def validate
needs :project_wiki
end
-
- def tag_class(type)
- "gfm gollum gollum-#{type}"
- end
end
end
end
diff --git a/spec/lib/banzai/filter/gollum_tags_filter_spec.rb b/spec/lib/banzai/filter/gollum_tags_filter_spec.rb
index ad777fe4b9c..fe2ce092e6b 100644
--- a/spec/lib/banzai/filter/gollum_tags_filter_spec.rb
+++ b/spec/lib/banzai/filter/gollum_tags_filter_spec.rb
@@ -70,7 +70,7 @@ describe Banzai::Filter::GollumTagsFilter, lib: true do
end
context 'linking internal resources' do
- it "the created link's text will include the resource's text and project_wiki_base_path" do
+ it "the created link's text includes the resource's text and wiki base path" do
tag = '[[wiki-slug]]'
doc = filter("See #{tag}", project_wiki: project_wiki)
expected_path = ::File.join(project_wiki.wiki_base_path, 'wiki-slug')
diff --git a/spec/lib/banzai/pipeline/wiki_pipeline_spec.rb b/spec/lib/banzai/pipeline/wiki_pipeline_spec.rb
index 4f86b1d87e3..7aa1b4a3bf6 100644
--- a/spec/lib/banzai/pipeline/wiki_pipeline_spec.rb
+++ b/spec/lib/banzai/pipeline/wiki_pipeline_spec.rb
@@ -1,9 +1,6 @@
require 'rails_helper'
describe Banzai::Pipeline::WikiPipeline do
- let(:project_wiki) { double }
- before(:each) { allow(project_wiki).to receive(:wiki_base_path) { '/some/repo/wikis' } }
-
describe 'TableOfContents' do
it 'replaces the tag with the TableOfContentsFilter result' do
markdown = <<-MD.strip_heredoc
@@ -14,7 +11,7 @@ describe Banzai::Pipeline::WikiPipeline do
Foo
MD
- result = described_class.call(markdown, project: spy, project_wiki: project_wiki)
+ result = described_class.call(markdown, project: spy, project_wiki: spy)
aggregate_failures do
expect(result[:output].text).not_to include '[['
@@ -32,7 +29,7 @@ describe Banzai::Pipeline::WikiPipeline do
Foo
MD
- output = described_class.to_html(markdown, project: spy, project_wiki: project_wiki)
+ output = described_class.to_html(markdown, project: spy, project_wiki: spy)
expect(output).to include('[[<em>toc</em>]]')
end
@@ -45,7 +42,7 @@ describe Banzai::Pipeline::WikiPipeline do
Foo
MD
- output = described_class.to_html(markdown, project: spy, project_wiki: project_wiki)
+ output = described_class.to_html(markdown, project: spy, project_wiki: spy)
aggregate_failures do
expect(output).not_to include('<ul>')