diff --git a/lib/fog/dnsimple/requests/dns/get_record.rb b/lib/fog/dnsimple/requests/dns/get_record.rb index 2c9167a72..990f47645 100644 --- a/lib/fog/dnsimple/requests/dns/get_record.rb +++ b/lib/fog/dnsimple/requests/dns/get_record.rb @@ -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 diff --git a/tests/dnsimple/requests/dns/dns_tests.rb b/tests/dnsimple/requests/dns/dns_tests.rb index 20f247ba2..0827d0e1a 100644 --- a/tests/dnsimple/requests/dns/dns_tests.rb +++ b/tests/dnsimple/requests/dns/dns_tests.rb @@ -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"]