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:
parent
25f50f761e
commit
3dd9711721
2 changed files with 19 additions and 0 deletions
|
@ -29,6 +29,16 @@ module Fog
|
|||
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
|
||||
|
|
|
@ -65,6 +65,15 @@ Shindo.tests('Fog::DNS[:dnsimple] | DNS requests', ['dnsimple', 'dns']) do
|
|||
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
|
||||
domain = @domain["name"]
|
||||
record_id = @record["id"]
|
||||
|
|
Loading…
Reference in a new issue