mirror of
https://github.com/internetee/registry.git
synced 2025-05-19 02:39:37 +02:00
parent
0042fc2d5a
commit
e08afe0983
2 changed files with 19 additions and 0 deletions
|
@ -589,4 +589,9 @@ class Contact < ActiveRecord::Base
|
||||||
return if priv?
|
return if priv?
|
||||||
ident
|
ident
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def id_code
|
||||||
|
return unless priv?
|
||||||
|
ident
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -481,4 +481,18 @@ RSpec.describe Contact, db: false do
|
||||||
specify { expect(reg_no).to be_nil }
|
specify { expect(reg_no).to be_nil }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe '#id_code' do
|
||||||
|
context 'when contact is private entity' do
|
||||||
|
let(:contact) { FactoryGirl.build_stubbed(:contact_private_entity, ident: '1234') }
|
||||||
|
|
||||||
|
specify { expect(contact.id_code).to eq('1234') }
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'when contact is legal entity' do
|
||||||
|
let(:contact) { FactoryGirl.build_stubbed(:contact_legal_entity, ident: '1234') }
|
||||||
|
|
||||||
|
specify { expect(contact.id_code).to be_nil }
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue