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

This commit is contained in:
KMY 2024-09-18 08:31:34 +09:00
commit 4ce35dd837
188 changed files with 1994 additions and 980 deletions

View file

@ -130,4 +130,13 @@ RSpec.describe CustomEmoji, :attachment_processing do
it { is_expected.to normalize(:domain).from(nil).to(nil) }
end
end
describe 'Validations' do
subject { Fabricate.build :custom_emoji }
it { is_expected.to validate_uniqueness_of(:shortcode).scoped_to(:domain) }
it { is_expected.to validate_length_of(:shortcode).is_at_least(described_class::MINIMUM_SHORTCODE_SIZE) }
it { is_expected.to allow_values('cats').for(:shortcode) }
it { is_expected.to_not allow_values('@#$@#$', 'X').for(:shortcode) }
end
end