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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
f377f826
Commit
f377f826
authored
Oct 04, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed banzai test failures
parent
cd2556e7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
spec/lib/banzai/filter/syntax_highlight_filter_spec.rb
spec/lib/banzai/filter/syntax_highlight_filter_spec.rb
+4
-4
No files found.
spec/lib/banzai/filter/syntax_highlight_filter_spec.rb
View file @
f377f826
...
@@ -6,21 +6,21 @@ describe Banzai::Filter::SyntaxHighlightFilter, lib: true do
...
@@ -6,21 +6,21 @@ describe Banzai::Filter::SyntaxHighlightFilter, lib: true do
context
"when no language is specified"
do
context
"when no language is specified"
do
it
"highlights as plaintext"
do
it
"highlights as plaintext"
do
result
=
filter
(
'<pre><code>def fun end</code></pre>'
)
result
=
filter
(
'<pre><code>def fun end</code></pre>'
)
expect
(
result
.
to_html
).
to
eq
(
'<pre class="code highlight js-syntax-highlight plaintext"><code>def fun end</code></pre>'
)
expect
(
result
.
to_html
).
to
eq
(
'<pre class="code highlight js-syntax-highlight plaintext"
v-pre="true"
><code>def fun end</code></pre>'
)
end
end
end
end
context
"when a valid language is specified"
do
context
"when a valid language is specified"
do
it
"highlights as that language"
do
it
"highlights as that language"
do
result
=
filter
(
'<pre><code class="ruby">def fun end</code></pre>'
)
result
=
filter
(
'<pre><code class="ruby">def fun end</code></pre>'
)
expect
(
result
.
to_html
).
to
eq
(
'<pre class="code highlight js-syntax-highlight ruby"><code><span class="k">def</span> <span class="nf">fun</span> <span class="k">end</span></code></pre>'
)
expect
(
result
.
to_html
).
to
eq
(
'<pre class="code highlight js-syntax-highlight ruby"
v-pre="true"
><code><span class="k">def</span> <span class="nf">fun</span> <span class="k">end</span></code></pre>'
)
end
end
end
end
context
"when an invalid language is specified"
do
context
"when an invalid language is specified"
do
it
"highlights as plaintext"
do
it
"highlights as plaintext"
do
result
=
filter
(
'<pre><code class="gnuplot">This is a test</code></pre>'
)
result
=
filter
(
'<pre><code class="gnuplot">This is a test</code></pre>'
)
expect
(
result
.
to_html
).
to
eq
(
'<pre class="code highlight js-syntax-highlight plaintext"><code>This is a test</code></pre>'
)
expect
(
result
.
to_html
).
to
eq
(
'<pre class="code highlight js-syntax-highlight plaintext"
v-pre="true"
><code>This is a test</code></pre>'
)
end
end
end
end
...
@@ -31,7 +31,7 @@ describe Banzai::Filter::SyntaxHighlightFilter, lib: true do
...
@@ -31,7 +31,7 @@ describe Banzai::Filter::SyntaxHighlightFilter, lib: true do
it
"highlights as plaintext"
do
it
"highlights as plaintext"
do
result
=
filter
(
'<pre><code class="ruby">This is a test</code></pre>'
)
result
=
filter
(
'<pre><code class="ruby">This is a test</code></pre>'
)
expect
(
result
.
to_html
).
to
eq
(
'<pre class="code highlight"><code>This is a test</code></pre>'
)
expect
(
result
.
to_html
).
to
eq
(
'<pre class="code highlight"
v-pre="true"
><code>This is a test</code></pre>'
)
end
end
end
end
end
end
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