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
Boxiang Sun
gitlab-ce
Commits
d520fe07
Commit
d520fe07
authored
Apr 06, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix GitlabMarkdownHelper spec
parent
96c2b940
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
spec/helpers/gitlab_markdown_helper_spec.rb
spec/helpers/gitlab_markdown_helper_spec.rb
+3
-3
spec/lib/gitlab/markdown/commit_range_reference_filter_spec.rb
...lib/gitlab/markdown/commit_range_reference_filter_spec.rb
+8
-0
No files found.
spec/helpers/gitlab_markdown_helper_spec.rb
View file @
d520fe07
...
@@ -51,8 +51,8 @@ describe GitlabMarkdownHelper do
...
@@ -51,8 +51,8 @@ describe GitlabMarkdownHelper do
end
end
it
"should not touch HTML entities"
do
it
"should not touch HTML entities"
do
allow
(
@project
.
issues
).
to
receive
(
:where
).
allow
(
@project
).
to
receive
(
:issue_exists?
).
with
(
id:
'39'
).
and_return
([
issue
])
with
(
39
).
and_return
([
issue
])
actual
=
'We'll accept good pull requests.'
actual
=
'We'll accept good pull requests.'
expect
(
gfm
(
actual
)).
to
eq
(
"We'll accept good pull requests."
)
expect
(
gfm
(
actual
)).
to
eq
(
"We'll accept good pull requests."
)
end
end
...
@@ -609,7 +609,7 @@ describe GitlabMarkdownHelper do
...
@@ -609,7 +609,7 @@ describe GitlabMarkdownHelper do
end
end
it
"should leave ref-like href of 'manual' links untouched"
do
it
"should leave ref-like href of 'manual' links untouched"
do
expect
(
markdown
(
"why not [inspect !
#{
merge_request
.
iid
}
](http://example.tld/#!
#{
merge_request
.
iid
}
)"
)).
to
eq
(
"<p>why not <a href=
\"
http://example.tld/#!
#{
merge_request
.
iid
}
\"
>inspect </a><a href=
\"
#{
namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request
)
}
\"
title=
\"
Merge Request:
#{
merge_request
.
title
}
\"
class=
\"
gfm gfm-merge_request
\"
>!
#{
merge_request
.
iid
}
</a><a href=
\"
http://example.tld/#!
#{
merge_request
.
iid
}
\"
></a></p>
\n
"
)
expect
(
markdown
(
"why not [inspect !
#{
merge_request
.
iid
}
](http://example.tld/#!
#{
merge_request
.
iid
}
)"
)).
to
eq
(
"<p>why not <a href=
\"
http://example.tld/#!
#{
merge_request
.
iid
}
\"
>inspect </a><a href=
\"
#{
namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request
)
}
\"
title=
\"
Merge Request:
#{
merge_request
.
title
}
\"
class=
\"
gfm gfm-merge_request
\"
>!
#{
merge_request
.
iid
}
</a><a href=
\"
http://example.tld/#!
#{
merge_request
.
iid
}
\"
></a></p>
\n
"
)
end
end
it
"should leave ref-like src of images untouched"
do
it
"should leave ref-like src of images untouched"
do
...
...
spec/lib/gitlab/markdown/commit_range_reference_filter_spec.rb
View file @
d520fe07
...
@@ -38,6 +38,14 @@ module Gitlab::Markdown
...
@@ -38,6 +38,14 @@ module Gitlab::Markdown
to
eq
urls
.
namespace_project_compare_url
(
project
.
namespace
,
project
,
from:
commit1
.
id
,
to:
commit2
.
id
)
to
eq
urls
.
namespace_project_compare_url
(
project
.
namespace
,
project
,
from:
commit1
.
id
,
to:
commit2
.
id
)
end
end
it
'links to a valid short ID'
do
reference
=
"
#{
commit1
.
short_id
}
...
#{
commit2
.
id
}
"
reference2
=
"
#{
commit1
.
id
}
...
#{
commit2
.
short_id
}
"
expect
(
filter
(
"See
#{
reference
}
"
).
css
(
'a'
).
first
.
text
).
to
eq
reference
expect
(
filter
(
"See
#{
reference2
}
"
).
css
(
'a'
).
first
.
text
).
to
eq
reference2
end
it
'links with adjacent text'
do
it
'links with adjacent text'
do
doc
=
filter
(
"See (
#{
reference
}
.)"
)
doc
=
filter
(
"See (
#{
reference
}
.)"
)
expect
(
doc
.
to_html
).
to
match
(
/\(<a.+>
#{
Regexp
.
escape
(
reference
)
}
<\/a>\.\)/
)
expect
(
doc
.
to_html
).
to
match
(
/\(<a.+>
#{
Regexp
.
escape
(
reference
)
}
<\/a>\.\)/
)
...
...
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