mirror of
https://github.com/internetee/registry.git
synced 2025-07-02 01:03:35 +02:00
Dnskey spec
This commit is contained in:
parent
7a647682df
commit
da6b115f6f
4 changed files with 25 additions and 0 deletions
7
spec/fabricators/dnskey_fabricator.rb
Normal file
7
spec/fabricators/dnskey_fabricator.rb
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
Fabricator(:dnskey) do
|
||||||
|
alg 8
|
||||||
|
flags 257
|
||||||
|
protocol 3
|
||||||
|
public_key 'AwEAAaOf5+lz3ftsL+0CCvfJbhUF/NVsNh8BKo61oYs5fXVbuWDiH872 LC8uKDO92TJy7Q4TF9XMAKMMlf1GMAxlRspD749SOCTN00sqfWx1OMTu a28L1PerwHq7665oDJDKqR71btcGqyLKhe2QDvCdA0mENimF1NudX1BJ DDFi6oOZ0xE/0CuveB64I3ree7nCrwLwNs56kXC4LYoX3XdkOMKiJLL/ MAhcxXa60CdZLoRtTEW3z8/oBq4hEAYMCNclpbd6y/exScwBxFTdUfFk KsdNcmvai1lyk9vna0WQrtpYpHKMXvY9LFHaJxCOLR4umfeQ42RuTd82 lqfU6ClMeXs='
|
||||||
|
ds_digest_type 2
|
||||||
|
end
|
|
@ -8,4 +8,5 @@ Fabricator(:domain) do
|
||||||
admin_contacts(count: 1) { Fabricate(:contact) }
|
admin_contacts(count: 1) { Fabricate(:contact) }
|
||||||
registrar
|
registrar
|
||||||
auth_info '98oiewslkfkd'
|
auth_info '98oiewslkfkd'
|
||||||
|
dnskeys(count: 1)
|
||||||
end
|
end
|
||||||
|
|
16
spec/models/dnskey_spec.rb
Normal file
16
spec/models/dnskey_spec.rb
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
describe Dnskey do
|
||||||
|
before(:each) { Fabricate(:domain_validation_setting_group) }
|
||||||
|
|
||||||
|
it { should belong_to(:domain) }
|
||||||
|
|
||||||
|
it 'generates digest' do
|
||||||
|
|
||||||
|
d = Fabricate(:domain, name: 'ria.ee')
|
||||||
|
ds = d.dnskeys.first
|
||||||
|
|
||||||
|
ds.generate_digest
|
||||||
|
expect(ds.ds_digest).to eq('0B62D1BC64EFD1EE652FB102BDF1011BF514CCD9A1A0CFB7472AEA3B01F38C92')
|
||||||
|
end
|
||||||
|
end
|
|
@ -7,6 +7,7 @@ describe Domain do
|
||||||
it { should have_many(:tech_contacts) }
|
it { should have_many(:tech_contacts) }
|
||||||
it { should have_many(:admin_contacts) }
|
it { should have_many(:admin_contacts) }
|
||||||
it { should have_many(:domain_transfers) }
|
it { should have_many(:domain_transfers) }
|
||||||
|
it { should have_many(:dnskeys) }
|
||||||
|
|
||||||
context 'with sufficient settings' do
|
context 'with sufficient settings' do
|
||||||
before(:each) { Fabricate(:domain_validation_setting_group) }
|
before(:each) { Fabricate(:domain_validation_setting_group) }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue