mirror of
https://github.com/internetee/registry.git
synced 2025-07-03 09:43:36 +02:00
Fix tests
This commit is contained in:
parent
eb8de6479e
commit
290d7470f8
3 changed files with 8 additions and 2 deletions
|
@ -33,7 +33,7 @@ class Domain < ActiveRecord::Base
|
|||
validates :owner_contact, presence: true
|
||||
|
||||
validate :validate_period
|
||||
validate :validate_nameservers_uniqueness
|
||||
#validate :validate_nameservers_uniqueness
|
||||
|
||||
def name=(value)
|
||||
value.strip!
|
||||
|
|
|
@ -2,7 +2,7 @@ class Nameserver < ActiveRecord::Base
|
|||
include EppErrors
|
||||
|
||||
EPP_ATTR_MAP = {
|
||||
hostname: 'hostName'
|
||||
hostname: 'hostObj'
|
||||
}
|
||||
|
||||
belongs_to :registrar
|
||||
|
@ -12,8 +12,13 @@ class Nameserver < ActiveRecord::Base
|
|||
validates :ipv4, format: { with: /\A(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\z/, 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 }
|
||||
|
||||
validates :hostname, uniqueness: { scope: :domain_id }
|
||||
|
||||
def epp_code_map
|
||||
{
|
||||
'2302' => [
|
||||
[:hostname, :taken]
|
||||
],
|
||||
'2005' => [
|
||||
[:hostname, :invalid],
|
||||
[:ipv4, :invalid],
|
||||
|
|
|
@ -99,6 +99,7 @@ en:
|
|||
attributes:
|
||||
hostname:
|
||||
invalid: 'Hostname is invalid'
|
||||
taken: 'Nameserver already exists on this domain'
|
||||
ipv4:
|
||||
invalid: 'IPv4 is invalid'
|
||||
ipv6:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue