Add coverage for user model registration time validation (#35993)
This commit is contained in:
parent
dbf8d77cbb
commit
95432b47eb
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user