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
880a233e
Commit
880a233e
authored
Sep 05, 2012
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for parsing Emoji
parent
d480a478
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
spec/helpers/gitlab_markdown_helper_spec.rb
spec/helpers/gitlab_markdown_helper_spec.rb
+34
-0
No files found.
spec/helpers/gitlab_markdown_helper_spec.rb
View file @
880a233e
...
@@ -208,6 +208,40 @@ describe GitlabMarkdownHelper do
...
@@ -208,6 +208,40 @@ describe GitlabMarkdownHelper do
gfm
(
actual
).
should
match
(
expected
)
gfm
(
actual
).
should
match
(
expected
)
end
end
end
end
describe
"emoji"
do
it
"matches at the start of a string"
do
gfm
(
":+1:"
).
should
match
(
/<img/
)
end
it
"matches at the end of a string"
do
gfm
(
"This gets a :-1:"
).
should
match
(
/<img/
)
end
it
"matches with adjacent text"
do
gfm
(
"+1 (:+1:)"
).
should
match
(
/<img/
)
end
it
"has a title attribute"
do
gfm
(
":-1:"
).
should
match
(
/title=":-1:"/
)
end
it
"has an alt attribute"
do
gfm
(
":-1:"
).
should
match
(
/alt=":-1:"/
)
end
it
"has an emoji class"
do
gfm
(
":+1:"
).
should
match
(
'class="emoji"'
)
end
it
"keeps whitespace intact"
do
gfm
(
"This deserves a :+1: big time."
).
should
match
(
/deserves a <img.+\/> big time/
)
end
it
"ignores invalid emoji"
do
gfm
(
":invalid-emoji:"
).
should_not
match
(
/<img/
)
end
end
end
end
describe
"#link_to_gfm"
do
describe
"#link_to_gfm"
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