Skip to content

Commit

Permalink
Fixing parsing of zone.records.get(id) so that it parses a single rec…
Browse files Browse the repository at this point in the history
…ord 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.
  • Loading branch information
patio11 committed Nov 8, 2011
1 parent c8c4324 commit 21e8071
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/fog/slicehost/requests/dns/get_record.rb
Expand Up @@ -21,7 +21,7 @@ def get_record(record_id)
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
Expand Down
5 changes: 2 additions & 3 deletions tests/slicehost/requests/dns/dns_tests.rb
Expand Up @@ -183,7 +183,7 @@
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")
Expand Down Expand Up @@ -247,8 +247,7 @@

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
Expand Down

0 comments on commit 21e8071

Please sign in to comment.