Convert emojis controller spec to request spec (#31597)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
21
spec/requests/emojis_spec.rb
Normal file
21
spec/requests/emojis_spec.rb
Normal file
@@ -0,0 +1,21 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
describe 'Emojis' do
|
||||
describe 'GET /emojis/:id' do
|
||||
let(:emoji) { Fabricate(:custom_emoji, shortcode: 'coolcat') }
|
||||
|
||||
it 'returns http success with correct json' do
|
||||
get "/emojis/#{emoji.id}"
|
||||
|
||||
expect(response)
|
||||
.to have_http_status(200)
|
||||
expect(body_as_json)
|
||||
.to include(
|
||||
name: ':coolcat:',
|
||||
type: 'Emoji'
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user