disallow CID for registrar code and fix double code check

This commit is contained in:
Priit Tark 2015-05-06 12:54:02 +03:00
parent c27de39a15
commit 1f504e08ea
5 changed files with 36 additions and 7 deletions

View file

@ -120,5 +120,11 @@ describe Registrar do
i.sum.should == BigDecimal.new('240.0')
i.description.should == 'add some money'
end
fit 'should not allaw to use CID as code for leagcy reasons' do
registrar = Fabricate.build(:registrar, code: 'CID')
registrar.valid?
registrar.errors.full_messages.should == ['Code is forbidden to use']
end
end
end