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

Add mock and test for get_record

This commit is contained in:
Trae Robrock 2013-07-28 12:19:15 -07:00
parent 25f50f761e
commit 3dd9711721
2 changed files with 19 additions and 0 deletions

View file

@ -29,6 +29,16 @@ module Fog
end end
end end
class Mock
def get_record(domain, record_id)
response = Excon::Response.new
response.status = 200
response.body = self.data[:records][domain].detect { |record| record["record"]["id"] == record_id }
response
end
end
end end
end end
end end

View file

@ -65,6 +65,15 @@ Shindo.tests('Fog::DNS[:dnsimple] | DNS requests', ['dnsimple', 'dns']) do
end end
end end
test("get a record") do
domain = @domain["name"]
record_id = @record["id"]
response = Fog::DNS[:dnsimple].get_record(domain, record_id)
(response.status == 200) and (@record == response.body["record"])
end
test("update a record") do test("update a record") do
domain = @domain["name"] domain = @domain["name"]
record_id = @record["id"] record_id = @record["id"]