mirror of
https://github.com/internetee/registry.git
synced 2025-05-18 18:29:40 +02:00
Added registrar legacy migration and don't allow blank nor colon in code
This commit is contained in:
parent
834d638423
commit
8f23ef510d
4 changed files with 89 additions and 2 deletions
|
@ -65,6 +65,30 @@ describe Registrar do
|
|||
])
|
||||
end
|
||||
|
||||
it 'should remove blank from code' do
|
||||
registrar = Fabricate.build(:registrar, code: 'with blank')
|
||||
registrar.valid?
|
||||
registrar.errors.full_messages.should match_array([
|
||||
])
|
||||
registrar.code.should == 'WITHBLANK'
|
||||
end
|
||||
|
||||
it 'should remove colon from code' do
|
||||
registrar = Fabricate.build(:registrar, code: 'with colon:and:blank')
|
||||
registrar.valid?
|
||||
registrar.errors.full_messages.should match_array([
|
||||
])
|
||||
registrar.code.should == 'WITHCOLONANDBLANK'
|
||||
end
|
||||
|
||||
it 'should allow dot in code' do
|
||||
registrar = Fabricate.build(:registrar, code: 'with.dot')
|
||||
registrar.valid?
|
||||
registrar.errors.full_messages.should match_array([
|
||||
])
|
||||
registrar.code.should == 'WITH.DOT'
|
||||
end
|
||||
|
||||
it 'should have one version' do
|
||||
with_versioning do
|
||||
@registrar.versions.should == []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue