Refactor domain expiration email

#186
This commit is contained in:
Artur Beljajev 2016-10-28 00:36:12 +03:00
parent 39d7c6ad1d
commit ad0220088a
30 changed files with 697 additions and 59 deletions

View file

@ -0,0 +1,5 @@
FactoryGirl.define do
factory :admin_domain_contact, parent: :domain_contact, class: AdminDomainContact do
end
end

16
spec/factories/contact.rb Normal file
View file

@ -0,0 +1,16 @@
FactoryGirl.define do
factory :contact do
name 'test'
sequence(:code) { |n| "test#{n}" }
phone '+123.456789'
email 'test@test.com'
street 'test'
city 'test'
zip 12345
country_code 'EE'
ident '37605030299'
ident_type 'priv'
ident_country_code 'EE'
registrar
end
end

15
spec/factories/dnskey.rb Normal file
View file

@ -0,0 +1,15 @@
FactoryGirl.define do
factory :dnskey do
alg Dnskey::ALGORITHMS.first
flags Dnskey::FLAGS.first
protocol Dnskey::PROTOCOLS.first
ds_digest_type 2
domain
public_key 'AwEAAaOf5+lz3ftsL+0CCvfJbhUF/NVsNh8BKo61oYs5fXVbuWDiH872 '\
'LC8uKDO92TJy7Q4TF9XMAKMMlf1GMAxlRspD749SOCTN00sqfWx1OMTu '\
'a28L1PerwHq7665oDJDKqR71btcGqyLKhe2QDvCdA0mENimF1NudX1BJ '\
'DDFi6oOZ0xE/0CuveB64I3ree7nCrwLwNs56kXC4LYoX3XdkOMKiJLL/ '\
'MAhcxXa60CdZLoRtTEW3z8/oBq4hEAYMCNclpbd6y/exScwBxFTdUfFk '\
'KsdNcmvai1lyk9vna0WQrtpYpHKMXvY9LFHaJxCOLR4umfeQ42RuTd82 lqfU6ClMeXs='
end
end

15
spec/factories/domain.rb Normal file
View file

@ -0,0 +1,15 @@
FactoryGirl.define do
factory :domain do
sequence(:name) { |n| "test#{n}.com" }
period 1
period_unit 'y' # Year
registrar
registrant
after :build do |domain|
domain.nameservers << FactoryGirl.build_pair(:nameserver)
domain.admin_domain_contacts << FactoryGirl.build(:admin_domain_contact)
domain.tech_domain_contacts << FactoryGirl.build(:tech_domain_contact)
end
end
end

View file

@ -0,0 +1,5 @@
FactoryGirl.define do
factory :domain_contact do
contact
end
end

View file

@ -0,0 +1,6 @@
FactoryGirl.define do
factory :nameserver do
sequence(:hostname) { |n| "ns.test#{n}.ee" }
ipv4 '192.168.1.1'
end
end

View file

@ -0,0 +1,5 @@
FactoryGirl.define do
factory :registrant, parent: :contact, class: Registrant do
name 'test'
end
end

View file

@ -0,0 +1,13 @@
FactoryGirl.define do
factory :registrar do
sequence(:name) { |n| "test#{n}" }
sequence(:code) { |n| "test#{n}" }
sequence(:reg_no) { |n| "test#{n}" }
street 'test'
city 'test'
state 'test'
zip 'test'
email 'test@test.com'
country_code 'EE'
end
end

View file

@ -0,0 +1,5 @@
FactoryGirl.define do
factory :tech_domain_contact, parent: :domain_contact, class: TechDomainContact do
end
end