mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 10:45:58 +02:00
Fix error generation in dnskeys
This commit is contained in:
parent
89afe0bdf2
commit
d4dc39bf22
2 changed files with 12 additions and 12 deletions
|
@ -15,29 +15,29 @@ class DnskeyTest < ActiveSupport::TestCase
|
|||
dns.protocol = 3
|
||||
dns.alg = 8
|
||||
dns.public_key = @dnskey
|
||||
|
||||
|
||||
assert dns.save
|
||||
end
|
||||
|
||||
def test_invalid_algrorithm
|
||||
dns = Dnskey.new
|
||||
dns.alg = 666
|
||||
errors = dns.validate_algorithm
|
||||
assert_equal errors, ['Valid algorithms are: 3, 5, 6, 7, 8, 10, 13, 14']
|
||||
errors = dns.validate_algorithm.options[:values]
|
||||
assert_equal errors, 'Valid algorithms are: 3, 5, 6, 7, 8, 10, 13, 14'
|
||||
end
|
||||
|
||||
def test_invalid_protocol
|
||||
dns = Dnskey.new
|
||||
dns.protocol = 666
|
||||
errors = dns.validate_protocol
|
||||
assert_equal errors, ['Valid protocols are: 3']
|
||||
errors = dns.validate_protocol.options[:values]
|
||||
assert_equal errors, 'Valid protocols are: 3'
|
||||
end
|
||||
|
||||
def test_invalid_flags
|
||||
dns = Dnskey.new
|
||||
dns.flags = 666
|
||||
errors = dns.validate_flags
|
||||
assert_equal errors, ['Valid flags are: 0, 256, 257']
|
||||
errors = dns.validate_flags.options[:values]
|
||||
assert_equal errors, 'Valid flags are: 0, 256, 257'
|
||||
end
|
||||
|
||||
def test_ds_digest_type_one
|
||||
|
@ -49,10 +49,10 @@ class DnskeyTest < ActiveSupport::TestCase
|
|||
dns.protocol = 3
|
||||
dns.alg = 8
|
||||
dns.public_key = @dnskey
|
||||
|
||||
|
||||
assert dns.save
|
||||
|
||||
assert_equal dns.ds_digest_type, 1
|
||||
assert_equal dns.ds_digest, '640D173A44D9AF2856FBE282EE64CE11A76DBB84'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue