mirror of
https://github.com/internetee/registry.git
synced 2025-07-03 09:43:36 +02:00
Fix some rubocops errors
This commit is contained in:
parent
68b5391f06
commit
55aa7743b0
8 changed files with 66 additions and 65 deletions
|
@ -5,7 +5,6 @@ class DelegationSigner < ActiveRecord::Base
|
||||||
validate :validate_dnskeys_uniqueness
|
validate :validate_dnskeys_uniqueness
|
||||||
validate :validate_dnskeys_count
|
validate :validate_dnskeys_count
|
||||||
|
|
||||||
|
|
||||||
def epp_code_map
|
def epp_code_map
|
||||||
sg = SettingGroup.domain_validation
|
sg = SettingGroup.domain_validation
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,6 @@ class Nameserver < ActiveRecord::Base
|
||||||
validates :ipv6, format: { with: /(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))/, allow_blank: true }
|
validates :ipv6, format: { with: /(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))/, allow_blank: true }
|
||||||
# rubocop: enable Metrics/LineLength
|
# rubocop: enable Metrics/LineLength
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# archiving
|
# archiving
|
||||||
has_paper_trail class_name: 'NameserverVersion'
|
has_paper_trail class_name: 'NameserverVersion'
|
||||||
|
|
||||||
|
|
|
@ -4,12 +4,11 @@ class Setting < ActiveRecord::Base
|
||||||
has_many :domains, through: :domain_statuses
|
has_many :domains, through: :domain_statuses
|
||||||
validates :code, uniqueness: { scope: :setting_group_id }
|
validates :code, uniqueness: { scope: :setting_group_id }
|
||||||
|
|
||||||
#dnskeys
|
# dnskeys
|
||||||
DS_ALGORITHM = 'ds_algorithm'
|
DS_ALGORITHM = 'ds_algorithm'
|
||||||
ALLOW_DS_DATA = 'allow_ds_data'
|
ALLOW_DS_DATA = 'allow_ds_data'
|
||||||
ALLOW_DS_DATA_WITH_KEYS = 'allow_ds_data_with_keys'
|
ALLOW_DS_DATA_WITH_KEYS = 'allow_ds_data_with_keys'
|
||||||
ALLOW_KEY_DATA = 'allow_key_data'
|
ALLOW_KEY_DATA = 'allow_key_data'
|
||||||
DNSKEYS_MAX_COUNT = 'dnskeys_max_count'
|
DNSKEYS_MAX_COUNT = 'dnskeys_max_count'
|
||||||
DNSKEYS_MIN_COUNT = 'dnskeys_min_count'
|
DNSKEYS_MIN_COUNT = 'dnskeys_min_count'
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -12,6 +12,7 @@ describe 'EPP Contact', epp: true do
|
||||||
Fabricate(:epp_user, username: 'zone', registrar: zone)
|
Fabricate(:epp_user, username: 'zone', registrar: zone)
|
||||||
Fabricate(:epp_user, username: 'elkdata', registrar: elkdata)
|
Fabricate(:epp_user, username: 'elkdata', registrar: elkdata)
|
||||||
Fabricate(:domain_validation_setting_group)
|
Fabricate(:domain_validation_setting_group)
|
||||||
|
Fabricate(:dnskeys_setting_group)
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'create command' do
|
context 'create command' do
|
||||||
|
|
|
@ -51,6 +51,7 @@ describe Contact, '#relations_with_domain?' do
|
||||||
context 'with relation' do
|
context 'with relation' do
|
||||||
before(:each) do
|
before(:each) do
|
||||||
Fabricate(:domain_validation_setting_group)
|
Fabricate(:domain_validation_setting_group)
|
||||||
|
Fabricate(:dnskeys_setting_group)
|
||||||
Fabricate(:domain)
|
Fabricate(:domain)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,10 @@ describe Domain do
|
||||||
it { should have_many(:dnskeys) }
|
it { should have_many(:dnskeys) }
|
||||||
|
|
||||||
context 'with sufficient settings' do
|
context 'with sufficient settings' do
|
||||||
before(:each) { Fabricate(:domain_validation_setting_group) }
|
before(:each) do
|
||||||
|
Fabricate(:domain_validation_setting_group)
|
||||||
|
Fabricate(:dnskeys_setting_group)
|
||||||
|
end
|
||||||
|
|
||||||
it 'validates domain name' do
|
it 'validates domain name' do
|
||||||
d = Fabricate(:domain)
|
d = Fabricate(:domain)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue