diff options
author | Shuhei Kitagawa <shuheiktgw@users.noreply.github.com> | 2018-05-28 22:56:58 +0900 |
---|---|---|
committer | Yamagishi Kazutoshi <ykzts@desire.sh> | 2018-05-28 22:56:58 +0900 |
commit | b0b34a5e381c8dd97abd69d817a8b82d3019085b (patch) | |
tree | 9748d446130fd39aee6acbeffba09da1bb69d762 | |
parent | b87a1229c74aebec02cd08091f25613f6dff4428 (diff) |
Add a test for emojis_controller (#7652)
-rw-r--r-- | spec/controllers/emojis_controller_spec.rb | 17 |
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 |