Always require contact.registrar

This commit is contained in:
Artur Beljajev 2017-06-07 22:49:13 +03:00
parent af53313608
commit 821fabd083
2 changed files with 14 additions and 4 deletions

View file

@ -354,7 +354,7 @@ describe Contact, '.destroy_orphans' do
end
end
RSpec.describe Contact, db: false do
RSpec.describe Contact do
it { is_expected.to alias_attribute(:kind, :ident_type) }
describe '::names' do
@ -400,6 +400,16 @@ RSpec.describe Contact, db: false do
end
end
describe 'registrar validation', db: false do
let(:contact) { described_class.new }
it 'rejects absent' do
contact.registrar = nil
contact.validate
expect(contact.errors).to have_key(:registrar)
end
end
describe 'address validation', db: false do
let(:contact) { described_class.new }
subject(:errors) { contact.errors }