about summary refs log tree commit diff
path: root/spec/controllers/emojis_controller_spec.rb
diff options
context:
space:
mode:
authorSpencer Alves <impiaaa@gmail.com>2018-05-31 21:33:16 -0700
committerSpencer Alves <impiaaa@gmail.com>2018-05-31 21:33:16 -0700
commit7d2e6429c27c5ddc8ef3d2366c44329092e07f77 (patch)
tree7cfd2035f69616a369b2f3762ce9cefe61c2bd22 /spec/controllers/emojis_controller_spec.rb
parentf2ff167c1a8df9b2521d33fcca15b8d5c67c50b1 (diff)
parente396fbfe3bf4d2a404e78e73cff1a609dd0a9bfb (diff)
Merge branch 'glitch' into thread-icon
Diffstat (limited to 'spec/controllers/emojis_controller_spec.rb')
-rw-r--r--spec/controllers/emojis_controller_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/controllers/emojis_controller_spec.rb b/spec/controllers/emojis_controller_spec.rb
new file mode 100644
index 000000000..68bae256d
--- /dev/null
+++ b/spec/controllers/emojis_controller_spec.rb
@@ -0,0 +1,17 @@
+require 'rails_helper'
+
+describe EmojisController do
+  render_views
+
+  let(:emoji) { Fabricate(:custom_emoji) }
+
+  describe 'GET #show' do
+    subject(:responce) { get :show, params: { id: emoji.id, format: :json } }
+    subject(:body) { JSON.parse(response.body, symbolize_names: true) }
+
+    it 'returns the right response' do
+      expect(responce).to have_http_status 200
+      expect(body[:name]).to eq ':coolcat:'
+    end
+  end
+end