emojis_controller_spec.rb 438 B

1234567891011121314151617
  1. require 'rails_helper'
  2. describe EmojisController do
  3. render_views
  4. let(:emoji) { Fabricate(:custom_emoji) }
  5. describe 'GET #show' do
  6. subject(:response) { get :show, params: { id: emoji.id, format: :json } }
  7. subject(:body) { JSON.parse(response.body, symbolize_names: true) }
  8. it 'returns the right response' do
  9. expect(response).to have_http_status 200
  10. expect(body[:name]).to eq ':coolcat:'
  11. end
  12. end
  13. end