Move emoji auto-complete helper to ApplicationHelper
This commit is contained in:
parent
682f62fd4a
commit
eb92813757
3 changed files with 6 additions and 16 deletions
|
@ -98,6 +98,12 @@ module ApplicationHelper
|
||||||
[projects, default_nav, project_nav].flatten.to_json
|
[projects, default_nav, project_nav].flatten.to_json
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def emoji_autocomplete_source
|
||||||
|
# should be an array of strings
|
||||||
|
# so to_s can be called, because it is sufficient and to_json is too slow
|
||||||
|
Emoji::NAMES.to_s
|
||||||
|
end
|
||||||
|
|
||||||
def ldap_enable?
|
def ldap_enable?
|
||||||
Devise.omniauth_providers.include?(:ldap)
|
Devise.omniauth_providers.include?(:ldap)
|
||||||
end
|
end
|
||||||
|
|
|
@ -14,10 +14,4 @@ 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
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
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…
Add table
Reference in a new issue