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

This commit is contained in:
Matt Jankowski authored and GitHub committed 2025-12-16 15:58:39 +00:00
1 parent dbf8d77cbb
commit 95432b47eb
1 file changed
+9
+9
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