From 21e80718a5a56a02934e31a2e1f5fd9b152a8908 Mon Sep 17 00:00:00 2001 From: Patrick McKenzie Date: Tue, 8 Nov 2011 18:54:08 +0900 Subject: [PATCH] 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. --- lib/fog/slicehost/requests/dns/get_record.rb | 2 +- tests/slicehost/requests/dns/dns_tests.rb | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/fog/slicehost/requests/dns/get_record.rb b/lib/fog/slicehost/requests/dns/get_record.rb index fada77ff1..90f63ef0d 100644 --- a/lib/fog/slicehost/requests/dns/get_record.rb +++ b/lib/fog/slicehost/requests/dns/get_record.rb @@ -21,7 +21,7 @@ module Fog request( :expects => 200, :method => 'GET', - :parser => Fog::Parsers::DNS::Slicehost::GetRecords.new, + :parser => Fog::Parsers::DNS::Slicehost::GetRecord.new, :path => "records/#{record_id}.xml" ) end diff --git a/tests/slicehost/requests/dns/dns_tests.rb b/tests/slicehost/requests/dns/dns_tests.rb index 94f0b7ac4..400b32586 100644 --- a/tests/slicehost/requests/dns/dns_tests.rb +++ b/tests/slicehost/requests/dns/dns_tests.rb @@ -183,7 +183,7 @@ Shindo.tests('Fog::DNS[:slicehost] | DNS requests', ['slicehost', 'dns']) do response = Fog::DNS[:slicehost].get_record(@record_id) if response.status == 200 mail_domain = 'mail.' + @domain - record = response.body['records'][0] + record = response.body if (record['record_type'] == 'MX') and (record['name'] == @domain) and (record['value'] == mail_domain) and (record['ttl'] == 3600) and (record['active'] == 'N') and (record['aux'] == "10") @@ -247,8 +247,7 @@ Shindo.tests('Fog::DNS[:slicehost] | DNS requests', ['slicehost', 'dns']) do mail_domain = 'mail.' + @domain - records = Fog::DNS[:slicehost].get_record(specific_record['id']).body["records"] - record = records[0] + record = Fog::DNS[:slicehost].get_record(specific_record['id']).body if (record['record_type'] == 'MX') and (record['name'] == @domain) and (record['value'] == mail_domain) and (record['ttl'] == 7200) and (record['active'] == 'N') and