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
bd807fe0
Commit
bd807fe0
authored
Aug 15, 2018
by
Brett Walker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
url_helpers were not available on a code reload
parent
f6097cbf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
spec/helpers/markup_helper_spec.rb
spec/helpers/markup_helper_spec.rb
+13
-9
No files found.
spec/helpers/markup_helper_spec.rb
View file @
bd807fe0
...
@@ -25,17 +25,17 @@ describe MarkupHelper do
...
@@ -25,17 +25,17 @@ describe MarkupHelper do
let
(
:actual
)
{
"
#{
merge_request
.
to_reference
}
->
#{
commit
.
to_reference
}
->
#{
issue
.
to_reference
}
"
}
let
(
:actual
)
{
"
#{
merge_request
.
to_reference
}
->
#{
commit
.
to_reference
}
->
#{
issue
.
to_reference
}
"
}
it
"links to the merge request"
do
it
"links to the merge request"
do
expected
=
project_merge_request_path
(
project
,
merge_request
)
expected
=
urls
.
project_merge_request_path
(
project
,
merge_request
)
expect
(
helper
.
markdown
(
actual
)).
to
match
(
expected
)
expect
(
helper
.
markdown
(
actual
)).
to
match
(
expected
)
end
end
it
"links to the commit"
do
it
"links to the commit"
do
expected
=
project_commit_path
(
project
,
commit
)
expected
=
urls
.
project_commit_path
(
project
,
commit
)
expect
(
helper
.
markdown
(
actual
)).
to
match
(
expected
)
expect
(
helper
.
markdown
(
actual
)).
to
match
(
expected
)
end
end
it
"links to the issue"
do
it
"links to the issue"
do
expected
=
project_issue_path
(
project
,
issue
)
expected
=
urls
.
project_issue_path
(
project
,
issue
)
expect
(
helper
.
markdown
(
actual
)).
to
match
(
expected
)
expect
(
helper
.
markdown
(
actual
)).
to
match
(
expected
)
end
end
end
end
...
@@ -46,7 +46,7 @@ describe MarkupHelper do
...
@@ -46,7 +46,7 @@ describe MarkupHelper do
let
(
:second_issue
)
{
create
(
:issue
,
project:
second_project
)
}
let
(
:second_issue
)
{
create
(
:issue
,
project:
second_project
)
}
it
'links to the issue'
do
it
'links to the issue'
do
expected
=
project_issue_path
(
second_project
,
second_issue
)
expected
=
urls
.
project_issue_path
(
second_project
,
second_issue
)
expect
(
markdown
(
actual
,
project:
second_project
)).
to
match
(
expected
)
expect
(
markdown
(
actual
,
project:
second_project
)).
to
match
(
expected
)
end
end
end
end
...
@@ -93,7 +93,7 @@ describe MarkupHelper do
...
@@ -93,7 +93,7 @@ describe MarkupHelper do
# First issue link
# First issue link
expect
(
doc
.
css
(
'a'
)[
1
].
attr
(
'href'
))
expect
(
doc
.
css
(
'a'
)[
1
].
attr
(
'href'
))
.
to
eq
project_issue_path
(
project
,
issues
[
0
])
.
to
eq
urls
.
project_issue_path
(
project
,
issues
[
0
])
expect
(
doc
.
css
(
'a'
)[
1
].
text
).
to
eq
issues
[
0
].
to_reference
expect
(
doc
.
css
(
'a'
)[
1
].
text
).
to
eq
issues
[
0
].
to_reference
# Internal commit link
# Internal commit link
...
@@ -102,7 +102,7 @@ describe MarkupHelper do
...
@@ -102,7 +102,7 @@ describe MarkupHelper do
# Second issue link
# Second issue link
expect
(
doc
.
css
(
'a'
)[
3
].
attr
(
'href'
))
expect
(
doc
.
css
(
'a'
)[
3
].
attr
(
'href'
))
.
to
eq
project_issue_path
(
project
,
issues
[
1
])
.
to
eq
urls
.
project_issue_path
(
project
,
issues
[
1
])
expect
(
doc
.
css
(
'a'
)[
3
].
text
).
to
eq
issues
[
1
].
to_reference
expect
(
doc
.
css
(
'a'
)[
3
].
text
).
to
eq
issues
[
1
].
to_reference
# Trailing commit link
# Trailing commit link
...
@@ -128,7 +128,7 @@ describe MarkupHelper do
...
@@ -128,7 +128,7 @@ describe MarkupHelper do
# First issue link
# First issue link
expect
(
doc
.
css
(
'a'
)[
1
].
attr
(
'href'
))
expect
(
doc
.
css
(
'a'
)[
1
].
attr
(
'href'
))
.
to
eq
project_issue_path
(
project
,
issues
[
0
])
.
to
eq
urls
.
project_issue_path
(
project
,
issues
[
0
])
expect
(
doc
.
css
(
'a'
)[
1
].
text
).
to
eq
issues
[
0
].
to_reference
expect
(
doc
.
css
(
'a'
)[
1
].
text
).
to
eq
issues
[
0
].
to_reference
# Internal commit link
# Internal commit link
...
@@ -137,7 +137,7 @@ describe MarkupHelper do
...
@@ -137,7 +137,7 @@ describe MarkupHelper do
# Second issue link
# Second issue link
expect
(
doc
.
css
(
'a'
)[
3
].
attr
(
'href'
))
expect
(
doc
.
css
(
'a'
)[
3
].
attr
(
'href'
))
.
to
eq
project_issue_path
(
project
,
issues
[
1
])
.
to
eq
urls
.
project_issue_path
(
project
,
issues
[
1
])
expect
(
doc
.
css
(
'a'
)[
3
].
text
).
to
eq
issues
[
1
].
to_reference
expect
(
doc
.
css
(
'a'
)[
3
].
text
).
to
eq
issues
[
1
].
to_reference
# Trailing commit link
# Trailing commit link
...
@@ -183,7 +183,7 @@ describe MarkupHelper do
...
@@ -183,7 +183,7 @@ describe MarkupHelper do
doc
=
Nokogiri
::
HTML
.
parse
(
rendered
)
doc
=
Nokogiri
::
HTML
.
parse
(
rendered
)
expect
(
doc
.
css
(
'a'
)[
0
].
attr
(
'href'
))
expect
(
doc
.
css
(
'a'
)[
0
].
attr
(
'href'
))
.
to
eq
project_issue_path
(
project
,
issue
)
.
to
eq
urls
.
project_issue_path
(
project
,
issue
)
expect
(
doc
.
css
(
'a'
)[
0
].
text
).
to
eq
issue
.
to_reference
expect
(
doc
.
css
(
'a'
)[
0
].
text
).
to
eq
issue
.
to_reference
wrapped
=
helper
.
link_to_html
(
rendered
,
link
)
wrapped
=
helper
.
link_to_html
(
rendered
,
link
)
...
@@ -414,4 +414,8 @@ describe MarkupHelper do
...
@@ -414,4 +414,8 @@ describe MarkupHelper do
expect
(
helper
.
cross_project_reference
(
project
,
issue
)).
to
include
(
project
.
full_path
)
expect
(
helper
.
cross_project_reference
(
project
,
issue
)).
to
include
(
project
.
full_path
)
end
end
end
end
def
urls
Gitlab
::
Routing
.
url_helpers
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