about summary refs log tree commit diff
path: root/spec/lib
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-07-21 04:27:40 +0200
committerGitHub <noreply@github.com>2017-07-21 04:27:40 +0200
commita390abdefb5d741ba4375858a79fbf3eaf30f06d (patch)
treeac1d1e4f0fdd4bc39139f2732cfea182e9aa2236 /spec/lib
parentc1bc5e14ebbecd8ffc6b4188fbf608e11f64422e (diff)
Use the same emoji data on the frontend and backend (#4284)
* Use the same emoji data on the frontend and backend

* Move emoji.json to repository, add tests

This way you don't need to install node dependencies if you only
want to run Ruby code
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/emoji_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/lib/emoji_spec.rb b/spec/lib/emoji_spec.rb
new file mode 100644
index 000000000..04931ccfb
--- /dev/null
+++ b/spec/lib/emoji_spec.rb
@@ -0,0 +1,15 @@
+require 'rails_helper'
+
+RSpec.describe Emoji do
+  describe '#unicode' do
+    it 'returns a unicode for a shortcode' do
+      expect(Emoji.instance.unicode(':joy:')).to eq '😂'
+    end
+  end
+
+  describe '#names' do
+    it 'returns an array' do
+      expect(Emoji.instance.names).to be_an Array
+    end
+  end
+end