Commit eb92813757d8ec14819ddbab6efae7e7cdd403e6
1 parent
682f62fd
Exists in
master
and in
4 other branches
Move emoji auto-complete helper to ApplicationHelper
Showing
3 changed files
with
6 additions
and
16 deletions
Show diff stats
app/helpers/application_helper.rb
| @@ -98,6 +98,12 @@ module ApplicationHelper | @@ -98,6 +98,12 @@ module ApplicationHelper | ||
| 98 | [projects, default_nav, project_nav].flatten.to_json | 98 | [projects, default_nav, project_nav].flatten.to_json |
| 99 | end | 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 | def ldap_enable? | 107 | def ldap_enable? |
| 102 | Devise.omniauth_providers.include?(:ldap) | 108 | Devise.omniauth_providers.include?(:ldap) |
| 103 | end | 109 | end |
app/helpers/notes_helper.rb
| @@ -14,10 +14,4 @@ module NotesHelper | @@ -14,10 +14,4 @@ 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 | ||
| 23 | end | 17 | end |
spec/helpers/notes_helper_spec.rb
| @@ -1,10 +0,0 @@ | @@ -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 |