Commit eb92813757d8ec14819ddbab6efae7e7cdd403e6

Authored by Riyad Preukschas
1 parent 682f62fd

Move emoji auto-complete helper to ApplicationHelper

app/helpers/application_helper.rb
... ... @@ -98,6 +98,12 @@ module ApplicationHelper
98 98 [projects, default_nav, project_nav].flatten.to_json
99 99 end
100 100  
  101 + def emoji_autocomplete_source
  102 + # should be an array of strings
  103 + # so to_s can be called, because it is sufficient and to_json is too slow
  104 + Emoji::NAMES.to_s
  105 + end
  106 +
101 107 def ldap_enable?
102 108 Devise.omniauth_providers.include?(:ldap)
103 109 end
... ...
app/helpers/notes_helper.rb
... ... @@ -14,10 +14,4 @@ module NotesHelper
14 14 "vote downvote"
15 15 end
16 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
23 17 end
... ...
spec/helpers/notes_helper_spec.rb
... ... @@ -1,10 +0,0 @@
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