Merge remote-tracking branch 'parent/main' into upstream-20240112

This commit is contained in:
KMY 2024-01-12 14:48:17 +09:00
commit e65fb9fb51
333 changed files with 2661 additions and 1461 deletions

View file

@ -124,12 +124,23 @@ RSpec.describe CustomEmoji do
end
end
describe 'pre_validation' do
let(:custom_emoji) { Fabricate(:custom_emoji, domain: 'wWw.MaStOdOn.CoM') }
describe 'Normalizations' do
describe 'downcase domain value' do
context 'with a mixed case domain value' do
it 'normalizes the value to downcased' do
custom_emoji = Fabricate.build(:custom_emoji, domain: 'wWw.MaStOdOn.CoM')
it 'downcases' do
custom_emoji.valid?
expect(custom_emoji.domain).to eq('www.mastodon.com')
expect(custom_emoji.domain).to eq('www.mastodon.com')
end
end
context 'with a nil domain value' do
it 'leaves the value as nil' do
custom_emoji = Fabricate.build(:custom_emoji, domain: nil)
expect(custom_emoji.domain).to be_nil
end
end
end
end
end