Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
1575a95b
Commit
1575a95b
authored
Apr 06, 2016
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
little refactor and improvements on specs
parent
207b7218
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
13 deletions
+6
-13
lib/banzai/filter/gollum_tags_filter.rb
lib/banzai/filter/gollum_tags_filter.rb
+2
-6
spec/lib/banzai/filter/gollum_tags_filter_spec.rb
spec/lib/banzai/filter/gollum_tags_filter_spec.rb
+1
-1
spec/lib/banzai/pipeline/wiki_pipeline_spec.rb
spec/lib/banzai/pipeline/wiki_pipeline_spec.rb
+3
-6
No files found.
lib/banzai/filter/gollum_tags_filter.rb
View file @
1575a95b
...
...
@@ -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
spec/lib/banzai/filter/gollum_tags_filter_spec.rb
View file @
1575a95b
...
...
@@ -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'
)
...
...
spec/lib/banzai/pipeline/wiki_pipeline_spec.rb
View file @
1575a95b
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>'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment