1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[dns|rackspace] list_domains request

This commit is contained in:
Brian Hartsock 2011-08-16 20:59:57 -04:00
parent cc40adc46b
commit d6d9840dd8
3 changed files with 55 additions and 0 deletions

View file

@ -17,6 +17,10 @@ module Fog
#collection :zones
request_path 'fog/dns/requests/rackspace'
request :list_domains
class Mock
end
class Real
def initialize(options={})

View file

@ -0,0 +1,15 @@
module Fog
module DNS
class Rackspace
class Real
def list_domains(options={})
request(
:expects => 200,
:method => 'GET',
:path => 'domains'
)
end
end
end
end
end

View file

@ -0,0 +1,36 @@
Shindo.tests('Fog::DNS[:rackspace] | DNS requests', ['rackspace', 'dns']) do
@domain = ''
@new_zones = []
@new_records =[]
@service = Fog::DNS[:rackspace]
LIST_DOMAIN_FORMAT = {
'domains' => [
{
'name' => String,
'id' => Integer,
'accountId' => Integer,
'updated' => String,
'created' => String
}
],
'totalEntries' => Integer,
'links' => [
{
'rel' => String,
'href' => String
}
]
}
tests( 'success') do
tests('list_domains').formats(LIST_DOMAIN_FORMAT) do
@service.list_domains.body
end
end
tests( 'failure') do
end
end