about summary refs log tree commit diff
path: root/spec
diff options
context:
space:
mode:
authorShuhei Kitagawa <shuheiktgw@users.noreply.github.com>2018-05-28 22:56:58 +0900
committerYamagishi Kazutoshi <ykzts@desire.sh>2018-05-28 22:56:58 +0900
commitb0b34a5e381c8dd97abd69d817a8b82d3019085b (patch)
tree9748d446130fd39aee6acbeffba09da1bb69d762 /spec
parentb87a1229c74aebec02cd08091f25613f6dff4428 (diff)
Add a test for emojis_controller (#7652)
Diffstat (limited to 'spec')
-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