Revision c1994b8f
Added by Ewoud Kohl van Wijngaarden over 8 years ago
test/dns/dns_api_test.rb | ||
---|---|---|
|
||
def test_create_a_record
|
||
post '/', :fqdn => 'test.com', :value => '192.168.33.33', :type => 'A'
|
||
assert_equal 200, last_response.status
|
||
assert_equal 'test.com', @server.fqdn
|
||
assert_equal '192.168.33.33', @server.ip
|
||
assert_equal 'A', @server.type
|
||
... | ... | |
end
|
||
|
||
def test_create_ptr_record
|
||
post '/', :fqdn => 'test.com', :value => '192.168.33.33', :type => 'PTR'
|
||
post '/', :fqdn => 'test.com', :value => '33.33.168.192.in-addr.arpa', :type => 'PTR'
|
||
assert_equal 200, last_response.status
|
||
assert_equal 'test.com', @server.fqdn
|
||
assert_equal '192.168.33.33', @server.ip
|
||
assert_equal '33.33.168.192.in-addr.arpa', @server.ip
|
||
assert_equal 'PTR', @server.type
|
||
end
|
||
|
||
def test_delete_a_record
|
||
delete '/test.com'
|
||
assert_equal 200, last_response.status
|
||
assert_equal 'test.com', @server.fqdn
|
||
assert_equal 'A', @server.type
|
||
end
|
||
|
||
def test_delete_ptr_record
|
||
delete '/33.33.168.192.in-addr.arpa'
|
||
assert_equal 200, last_response.status
|
||
assert_equal '33.33.168.192.in-addr.arpa', @server.ip
|
||
assert_equal 'PTR', @server.type
|
||
end
|
Also available in: Unified diff
Refs #12209: Pass in the actual values to {create,remove}_ptr_record