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
9d15814e
Commit
9d15814e
authored
Mar 18, 2016
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix specs
parent
73881224
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
spec/helpers/labels_helper_spec.rb
spec/helpers/labels_helper_spec.rb
+10
-2
spec/lib/banzai/filter/label_reference_filter_spec.rb
spec/lib/banzai/filter/label_reference_filter_spec.rb
+1
-1
No files found.
spec/helpers/labels_helper_spec.rb
View file @
9d15814e
...
...
@@ -11,7 +11,7 @@ describe LabelsHelper do
end
it
'uses the instance variable'
do
expect
(
link_to_label
(
label
)).
to
match
%r{<a href="/
#{
@project
.
to_reference
}
/issues
\?
label_name=
#{
label
.
name
}
">
.*
</a>}
expect
(
link_to_label
(
label
)).
to
match
%r{<a href="/
#{
@project
.
to_reference
}
/issues
\?
label_name=
#{
label
.
name
}
">
<span class="[
\w\s\-
]*has_tooltip".*</span>
</a>}
end
end
...
...
@@ -39,6 +39,14 @@ describe LabelsHelper do
end
end
context
'with a tooltip argument'
do
context
'set to false'
do
it
'does not include the has_tooltip class'
do
expect
(
link_to_label
(
label
,
tooltip:
false
)).
not_to
match
%r{has_tooltip}
end
end
end
context
'with block'
do
it
'passes the block to link_to'
do
link
=
link_to_label
(
label
)
{
'Foo'
}
...
...
@@ -49,7 +57,7 @@ describe LabelsHelper do
context
'without block'
do
it
'uses render_colored_label as the link content'
do
expect
(
self
).
to
receive
(
:render_colored_label
).
with
(
label
).
and_return
(
'Foo'
)
with
(
label
,
tooltip:
true
).
and_return
(
'Foo'
)
expect
(
link_to_label
(
label
)).
to
match
(
'Foo'
)
end
end
...
...
spec/lib/banzai/filter/label_reference_filter_spec.rb
View file @
9d15814e
...
...
@@ -56,7 +56,7 @@ describe Banzai::Filter::LabelReferenceFilter, lib: true do
describe
'label span element'
do
it
'includes default classes'
do
doc
=
reference_filter
(
"Label
#{
reference
}
"
)
expect
(
doc
.
css
(
'a span'
).
first
.
attr
(
'class'
)).
to
eq
'label color-label'
expect
(
doc
.
css
(
'a span'
).
first
.
attr
(
'class'
)).
to
eq
'label color-label
has_tooltip
'
end
it
'includes a style attribute'
do
...
...
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