Add emoji_for_completion helper
This commit is contained in:
parent
a54a90188b
commit
bbd92e57cb
|
@ -14,4 +14,10 @@ module NotesHelper
|
||||||
"vote downvote"
|
"vote downvote"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def emoji_for_completion
|
||||||
|
# should be an array of strings
|
||||||
|
# so to_s can be called, because it is sufficient and to_json is too slow
|
||||||
|
Emoji::NAMES
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
10
spec/helpers/notes_helper_spec.rb
Normal file
10
spec/helpers/notes_helper_spec.rb
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe NotesHelper do
|
||||||
|
describe "#emoji_for_completion" do
|
||||||
|
it "should be an Array of Strings" do
|
||||||
|
emoji_for_completion.should be_a(Array)
|
||||||
|
emoji_for_completion.each { |emoji| emoji.should be_a(String) }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue