From b0b34a5e381c8dd97abd69d817a8b82d3019085b Mon Sep 17 00:00:00 2001 From: Shuhei Kitagawa Date: Mon, 28 May 2018 22:56:58 +0900 Subject: [PATCH] Add a test for emojis_controller (#7652) --- spec/controllers/emojis_controller_spec.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 spec/controllers/emojis_controller_spec.rb 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