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

Fixing parsing of zone.records.get(id) so that it parses a single record properly rather than attempting to parse a list of records improperly. Fixing tests to match this (expected) behavior rather than work-around the broken way.

This commit is contained in:
Patrick McKenzie 2011-11-08 18:54:08 +09:00
parent c8c4324549
commit 21e80718a5
2 changed files with 3 additions and 4 deletions

View file

@ -21,7 +21,7 @@ module Fog
request( request(
:expects => 200, :expects => 200,
:method => 'GET', :method => 'GET',
:parser => Fog::Parsers::DNS::Slicehost::GetRecords.new, :parser => Fog::Parsers::DNS::Slicehost::GetRecord.new,
:path => "records/#{record_id}.xml" :path => "records/#{record_id}.xml"
) )
end end

View file

@ -183,7 +183,7 @@ Shindo.tests('Fog::DNS[:slicehost] | DNS requests', ['slicehost', 'dns']) do
response = Fog::DNS[:slicehost].get_record(@record_id) response = Fog::DNS[:slicehost].get_record(@record_id)
if response.status == 200 if response.status == 200
mail_domain = 'mail.' + @domain mail_domain = 'mail.' + @domain
record = response.body['records'][0] record = response.body
if (record['record_type'] == 'MX') and (record['name'] == @domain) and if (record['record_type'] == 'MX') and (record['name'] == @domain) and
(record['value'] == mail_domain) and (record['ttl'] == 3600) and (record['active'] == 'N') and (record['value'] == mail_domain) and (record['ttl'] == 3600) and (record['active'] == 'N') and
(record['aux'] == "10") (record['aux'] == "10")
@ -247,8 +247,7 @@ Shindo.tests('Fog::DNS[:slicehost] | DNS requests', ['slicehost', 'dns']) do
mail_domain = 'mail.' + @domain mail_domain = 'mail.' + @domain
records = Fog::DNS[:slicehost].get_record(specific_record['id']).body["records"] record = Fog::DNS[:slicehost].get_record(specific_record['id']).body
record = records[0]
if (record['record_type'] == 'MX') and (record['name'] == @domain) and if (record['record_type'] == 'MX') and (record['name'] == @domain) and
(record['value'] == mail_domain) and (record['ttl'] == 7200) and (record['active'] == 'N') and (record['value'] == mail_domain) and (record['ttl'] == 7200) and (record['active'] == 'N') and