mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 08:52:04 +02:00
Use FactoryBot factories instead of fabricators
This commit is contained in:
parent
0cd913daf8
commit
9fd02c738f
30 changed files with 241 additions and 267 deletions
|
@ -7,11 +7,11 @@ RSpec.describe Domain, db: false do
|
|||
before :example do
|
||||
travel_to Time.zone.parse('05.07.2010 00:00')
|
||||
|
||||
Fabricate(:zone, origin: 'ee')
|
||||
create(:zone, origin: 'ee')
|
||||
|
||||
Fabricate.create(:domain, id: 1, expire_time: Time.zone.parse('04.07.2010 23:59'))
|
||||
Fabricate.create(:domain, id: 2, expire_time: Time.zone.parse('05.07.2010 00:00'))
|
||||
Fabricate.create(:domain, id: 3, expire_time: Time.zone.parse('05.07.2010 00:01'))
|
||||
create(:domain, id: 1, expire_time: Time.zone.parse('04.07.2010 23:59'))
|
||||
create(:domain, id: 2, expire_time: Time.zone.parse('05.07.2010 00:00'))
|
||||
create(:domain, id: 3, expire_time: Time.zone.parse('05.07.2010 00:01'))
|
||||
end
|
||||
|
||||
it 'returns expired domains' do
|
||||
|
|
|
@ -4,11 +4,15 @@ RSpec.describe Domain do
|
|||
it { is_expected.to alias_attribute(:force_delete_time, :force_delete_at) }
|
||||
|
||||
before :example do
|
||||
Fabricate(:zone, origin: 'ee')
|
||||
create(:zone, origin: 'ee')
|
||||
end
|
||||
|
||||
it 'should set force delete time' do
|
||||
domain = Fabricate(:domain)
|
||||
domain = build(:domain)
|
||||
domain.nameservers.build(attributes_for(:nameserver))
|
||||
domain.nameservers.build(attributes_for(:nameserver))
|
||||
domain.save!
|
||||
|
||||
domain.statuses = ['ok']
|
||||
domain.schedule_force_delete
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue