Commit bbd92e57cb5c764baf5fbdb9ccb1a1cd140eeca9
1 parent
a54a9018
Exists in
master
and in
4 other branches
Add emoji_for_completion helper
Showing
2 changed files
with
16 additions
and
0 deletions
Show diff stats
app/helpers/notes_helper.rb
| @@ -14,4 +14,10 @@ module NotesHelper | @@ -14,4 +14,10 @@ module NotesHelper | ||
| 14 | "vote downvote" | 14 | "vote downvote" |
| 15 | end | 15 | end |
| 16 | end | 16 | end |
| 17 | + | ||
| 18 | + def emoji_for_completion | ||
| 19 | + # should be an array of strings | ||
| 20 | + # so to_s can be called, because it is sufficient and to_json is too slow | ||
| 21 | + Emoji::NAMES | ||
| 22 | + end | ||
| 17 | end | 23 | end |
| @@ -0,0 +1,10 @@ | @@ -0,0 +1,10 @@ | ||
| 1 | +require 'spec_helper' | ||
| 2 | + | ||
| 3 | +describe NotesHelper do | ||
| 4 | + describe "#emoji_for_completion" do | ||
| 5 | + it "should be an Array of Strings" do | ||
| 6 | + emoji_for_completion.should be_a(Array) | ||
| 7 | + emoji_for_completion.each { |emoji| emoji.should be_a(String) } | ||
| 8 | + end | ||
| 9 | + end | ||
| 10 | +end |