emojis_controller_spec.rb 466 B

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