about summary refs log tree commit diff
path: root/spec/helpers/emoji_helper_spec.rb
diff options
context:
space:
mode:
authorkibigo! <marrus-sh@users.noreply.github.com>2017-07-15 14:33:15 -0700
committerkibigo! <marrus-sh@users.noreply.github.com>2017-07-15 14:33:15 -0700
commit09cfc079b0958c42fe619e2d88c3f9fd1d7c7900 (patch)
tree156de790a5bec0fdf050e392bee8a64b220d3a9d /spec/helpers/emoji_helper_spec.rb
parent08d021916db9e350259b925d7e562aa13ba37422 (diff)
parent695439775eacea081c7257aabab39d0ec6b492dc (diff)
Merge upstream (#81)
Diffstat (limited to 'spec/helpers/emoji_helper_spec.rb')
-rw-r--r--spec/helpers/emoji_helper_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/helpers/emoji_helper_spec.rb b/spec/helpers/emoji_helper_spec.rb
new file mode 100644
index 000000000..1eedfb719
--- /dev/null
+++ b/spec/helpers/emoji_helper_spec.rb
@@ -0,0 +1,15 @@
+require 'rails_helper'
+
+RSpec.describe EmojiHelper, type: :helper do
+  describe '#emojify' do
+    it 'converts shortcodes to unicode' do
+      text = ':book: Book'
+      expect(emojify(text)).to eq '📖 Book'
+    end
+
+    it 'does not convert shortcodes that are part of a string into unicode' do
+      text = ':see_no_evil::hear_no_evil::speak_no_evil:'
+      expect(emojify(text)).to eq text
+    end
+  end
+end