From 7d00e4edbd0bef8791d8efee7665eb13bb256d7a Mon Sep 17 00:00:00 2001 From: Adam Copp Date: Tue, 11 Dec 2018 04:30:57 +0000 Subject: Make custom emoji domains case insensitive #9351 (#9474) * Make custom emoji domains case sensitive #9351 * Fixup style in downcase_domain to comply with codeclimate. * switch if! to unless * Don't use transactions, operate in batches. Also revert spurious schema change. --- spec/models/custom_emoji_spec.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'spec/models') diff --git a/spec/models/custom_emoji_spec.rb b/spec/models/custom_emoji_spec.rb index 320a258d3..9de218b4f 100644 --- a/spec/models/custom_emoji_spec.rb +++ b/spec/models/custom_emoji_spec.rb @@ -75,4 +75,13 @@ RSpec.describe CustomEmoji, type: :model do end end end + + describe 'pre_validation' do + let(:custom_emoji) { Fabricate(:custom_emoji, domain: 'wWw.MaStOdOn.CoM') } + + it 'should downcase' do + custom_emoji.valid? + expect(custom_emoji.domain).to eq('www.mastodon.com') + end + end end -- cgit