Convert spec to test

#746
This commit is contained in:
Artur Beljajev 2018-03-06 13:08:18 +02:00
parent bfbee65a49
commit 5319243e09
3 changed files with 21 additions and 30 deletions

View file

@ -413,36 +413,6 @@ RSpec.describe Contact do
end
end
describe '#used?' do
context 'when used as registrant' do
let(:registrant) { create(:registrant) }
before :example do
create(:domain, registrant: registrant)
registrant.reload
end
specify { expect(registrant).to be_used }
end
context 'when used as contact' do
let(:contact) { create(:contact) }
before :example do
domain = create(:domain)
domain.admin_domain_contacts << create(:admin_domain_contact, contact: contact)
contact.reload
end
specify { expect(contact).to be_used }
end
context 'when not used' do
let(:contact) { create(:contact) }
specify { expect(contact).to_not be_used }
end
end
describe '#domain_names_with_roles' do
let(:contact) { create(:registrant) }
subject(:domain_names) { contact.domain_names_with_roles }