Skip to content
Snippets Groups Projects
Commit 97fc2da2 authored by ysksn's avatar ysksn Committed by Yamagishi Kazutoshi
Browse files

Add tests for CustomEmoji#local? and #object_type (#5621)

parent 889ada5e
No related branches found
No related tags found
No related merge requests found
require 'rails_helper'
RSpec.describe CustomEmoji, type: :model do
describe '#local?' do
let(:custom_emoji) { Fabricate(:custom_emoji, domain: domain) }
subject { custom_emoji.local? }
context 'domain is nil' do
let(:domain) { nil }
it 'returns true' do
is_expected.to be true
end
end
context 'domain is present' do
let(:domain) { 'example.com' }
it 'returns false' do
is_expected.to be false
end
end
end
describe '#object_type' do
it 'returns :emoji' do
custom_emoji = Fabricate(:custom_emoji)
expect(custom_emoji.object_type).to be :emoji
end
end
describe '.from_text' do
let!(:emojo) { Fabricate(:custom_emoji) }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment