Refactor zones

- Rename "zonefile_setting" to "zone"
- Remove version

#475
This commit is contained in:
Artur Beljajev 2017-04-20 17:20:36 +03:00
parent f1d7e53734
commit bff7437277
51 changed files with 425 additions and 389 deletions

View file

@ -7,7 +7,7 @@ RSpec.describe Domain, db: false do
before :example do
travel_to Time.zone.parse('05.07.2010 00:00')
Fabricate(:zonefile_setting, origin: 'ee')
Fabricate(: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'))

View file

@ -4,7 +4,7 @@ RSpec.describe Domain do
it { is_expected.to alias_attribute(:force_delete_time, :force_delete_at) }
before :example do
Fabricate(:zonefile_setting, origin: 'ee')
Fabricate(:zone, origin: 'ee')
end
it 'should set force delete time' do

View file

@ -2,7 +2,7 @@ require 'rails_helper'
RSpec.describe Contact do
before :example do
Fabricate(:zonefile_setting, origin: 'ee')
Fabricate(:zone, origin: 'ee')
end
context 'about class' do
@ -328,7 +328,7 @@ end
describe Contact, '.destroy_orphans' do
before do
Fabricate(:zonefile_setting, origin: 'ee')
Fabricate(:zone, origin: 'ee')
@contact_1 = Fabricate(:contact, code: 'asd12')
@contact_2 = Fabricate(:contact, code: 'asd13')
end

View file

@ -1,10 +1,6 @@
require 'rails_helper'
RSpec.describe ZonefileSetting, db: false do
it 'has versions' do
expect(described_class.new.versions).to eq([])
end
RSpec.describe DNS::Zone do
describe '::origins' do
before :example do
expect(described_class).to receive(:pluck).with(:origin).and_return('origins')

View file

@ -21,7 +21,7 @@ describe Dnskey do
Setting.client_side_status_editing_enabled = true
Fabricate(:zonefile_setting, origin: 'ee')
Fabricate(:zone, origin: 'ee')
end
context 'with invalid attribute' do

View file

@ -2,7 +2,7 @@ require 'rails_helper'
RSpec.describe DomainCron do
it 'should expire domains' do
Fabricate(:zonefile_setting, origin: 'ee')
Fabricate(:zone, origin: 'ee')
@domain = Fabricate(:domain)
Setting.expire_warning_period = 1
@ -25,7 +25,7 @@ RSpec.describe DomainCron do
end
it 'should start redemption grace period' do
Fabricate(:zonefile_setting, origin: 'ee')
Fabricate(:zone, origin: 'ee')
@domain = Fabricate(:domain)
old_valid_to = Time.zone.now - 10.days

View file

@ -21,11 +21,11 @@ RSpec.describe Domain do
Setting.client_side_status_editing_enabled = true
Fabricate(:zonefile_setting, origin: 'ee')
Fabricate(:zonefile_setting, origin: 'pri.ee')
Fabricate(:zonefile_setting, origin: 'med.ee')
Fabricate(:zonefile_setting, origin: 'fie.ee')
Fabricate(:zonefile_setting, origin: 'com.ee')
Fabricate(:zone, origin: 'ee')
Fabricate(:zone, origin: 'pri.ee')
Fabricate(:zone, origin: 'med.ee')
Fabricate(:zone, origin: 'fie.ee')
Fabricate(:zone, origin: 'com.ee')
end
context 'with invalid attribute' do
@ -809,7 +809,7 @@ RSpec.describe Domain, db: false do
before :example do
travel_to Time.zone.parse('05.07.2010 00:00')
Fabricate(:zonefile_setting, origin: 'ee')
Fabricate(:zone, origin: 'ee')
Fabricate.create(:domain, id: 1, outzone_time: Time.zone.parse('04.07.2010 23:59'))
Fabricate.create(:domain, id: 2, outzone_time: Time.zone.parse('05.07.2010 00:00'))
@ -825,7 +825,7 @@ RSpec.describe Domain, db: false do
before :example do
travel_to Time.zone.parse('05.07.2010 00:00')
Fabricate(:zonefile_setting, origin: 'ee')
Fabricate(:zone, origin: 'ee')
Fabricate.create(:domain, id: 1, delete_time: Time.zone.parse('04.07.2010 23:59'))
Fabricate.create(:domain, id: 2, delete_time: Time.zone.parse('05.07.2010 00:00'))

View file

@ -21,7 +21,7 @@ describe DomainTransfer do
Setting.client_side_status_editing_enabled = true
Fabricate(:zonefile_setting, origin: 'ee')
Fabricate(:zone, origin: 'ee')
end
context 'with invalid attribute' do

View file

@ -21,7 +21,7 @@ describe Keyrelay do
Setting.client_side_status_editing_enabled = true
Fabricate(:zonefile_setting, origin: 'ee')
Fabricate(:zone, origin: 'ee')
end
context 'with invalid attribute' do

View file

@ -3,11 +3,11 @@ require 'rails_helper'
describe LegalDocument do
context 'tasks' do
it 'make files uniq' do
Fabricate(:zonefile_setting, origin: 'ee')
Fabricate(:zonefile_setting, origin: 'pri.ee')
Fabricate(:zonefile_setting, origin: 'med.ee')
Fabricate(:zonefile_setting, origin: 'fie.ee')
Fabricate(:zonefile_setting, origin: 'com.ee')
Fabricate(:zone, origin: 'ee')
Fabricate(:zone, origin: 'pri.ee')
Fabricate(:zone, origin: 'med.ee')
Fabricate(:zone, origin: 'fie.ee')
Fabricate(:zone, origin: 'com.ee')
LegalDocument.explicitly_write_file = true
PaperTrail.enabled = true

View file

@ -21,7 +21,7 @@ describe Nameserver do
Setting.client_side_status_editing_enabled = true
Fabricate(:zonefile_setting, origin: 'ee')
Fabricate(:zone, origin: 'ee')
end
context 'with invalid attribute' do

View file

@ -21,7 +21,7 @@ describe RegistrantVerification do
Setting.client_side_status_editing_enabled = true
Fabricate(:zonefile_setting, origin: 'ee')
Fabricate(:zone, origin: 'ee')
end
context 'with invalid attribute' do
before :example do