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
iv
gitlab-ce
Commits
30d1d47d
Commit
30d1d47d
authored
Apr 06, 2016
by
Alejandro Rodríguez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Using project `path_with_namespace` in milestone's cross project references link text
parent
0f925714
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
lib/banzai/filter/milestone_reference_filter.rb
lib/banzai/filter/milestone_reference_filter.rb
+1
-1
spec/lib/banzai/filter/milestone_reference_filter_spec.rb
spec/lib/banzai/filter/milestone_reference_filter_spec.rb
+3
-3
No files found.
lib/banzai/filter/milestone_reference_filter.rb
View file @
30d1d47d
...
...
@@ -39,7 +39,7 @@ module Banzai
if
context
[
:project
]
==
object
.
project
super
else
"
#{
escape_once
(
super
)
}
<i>in
#{
escape_once
(
object
.
project
.
name
_with_namespace
)
}
</i>"
.
"
#{
escape_once
(
super
)
}
<i>in
#{
escape_once
(
object
.
project
.
path
_with_namespace
)
}
</i>"
.
html_safe
end
end
...
...
spec/lib/banzai/filter/milestone_reference_filter_spec.rb
View file @
30d1d47d
...
...
@@ -160,7 +160,7 @@ describe Banzai::Filter::MilestoneReferenceFilter, lib: true do
describe
'cross project milestone references'
do
let
(
:another_project
)
{
create
(
:empty_project
,
:public
)
}
let
(
:project_
name
)
{
another_project
.
name
_with_namespace
}
let
(
:project_
path
)
{
another_project
.
path
_with_namespace
}
let
(
:milestone
)
{
create
(
:milestone
,
project:
another_project
)
}
let
(
:reference
)
{
milestone
.
to_reference
(
project
)
}
...
...
@@ -174,13 +174,13 @@ describe Banzai::Filter::MilestoneReferenceFilter, lib: true do
end
it
'contains cross project content'
do
expect
(
result
.
css
(
'a'
).
first
.
text
).
to
eq
"
#{
milestone
.
name
}
in
#{
project_
name
}
"
expect
(
result
.
css
(
'a'
).
first
.
text
).
to
eq
"
#{
milestone
.
name
}
in
#{
project_
path
}
"
end
it
'escapes the name attribute'
do
allow_any_instance_of
(
Milestone
).
to
receive
(
:title
).
and_return
(
%{"></a>whatever<a title="}
)
doc
=
reference_filter
(
"See
#{
reference
}
"
)
expect
(
doc
.
css
(
'a'
).
first
.
text
).
to
eq
"
#{
milestone
.
name
}
in
#{
project_
name
}
"
expect
(
doc
.
css
(
'a'
).
first
.
text
).
to
eq
"
#{
milestone
.
name
}
in
#{
project_
path
}
"
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