Add coverage for user model registration time validation (#35993)

This commit is contained in:
Matt Jankowski 2025-12-16 10:58:39 -05:00 committed by GitHub
parent dbf8d77cbb
commit 95432b47eb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -39,6 +39,15 @@ RSpec.describe User do
end
it { is_expected.to allow_value('admin@localhost').for(:email) }
context 'when registration form time is present' do
subject { Fabricate.build :user }
before { stub_const 'RegistrationFormTimeValidator::REGISTRATION_FORM_MIN_TIME', 3.seconds }
it { is_expected.to allow_value(10.seconds.ago).for(:registration_form_time) }
it { is_expected.to_not allow_value(1.second.ago).for(:registration_form_time).against(:base) }
end
end
describe 'Normalizations' do