OSDN Git Service

Move emoji auto-complete helper to ApplicationHelper
authorRiyad Preukschas <riyad@informatik.uni-bremen.de>
Tue, 9 Oct 2012 22:53:42 +0000 (00:53 +0200)
committerRiyad Preukschas <riyad@informatik.uni-bremen.de>
Tue, 9 Oct 2012 22:53:42 +0000 (00:53 +0200)
app/helpers/application_helper.rb
app/helpers/notes_helper.rb
spec/helpers/notes_helper_spec.rb [deleted file]

index 911b46c..8c65a0f 100644 (file)
@@ -98,6 +98,12 @@ module ApplicationHelper
     [projects, default_nav, project_nav].flatten.to_json
   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?
     Devise.omniauth_providers.include?(:ldap)
   end
index 9f75fc4..65389e3 100644 (file)
@@ -14,10 +14,4 @@ module NotesHelper
       "vote downvote"
     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
diff --git a/spec/helpers/notes_helper_spec.rb b/spec/helpers/notes_helper_spec.rb
deleted file mode 100644 (file)
index 7348169..0000000
+++ /dev/null
@@ -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