Skip to content

Commit

Permalink
The record object has zone_id instead of domain_id
Browse files Browse the repository at this point in the history
  • Loading branch information
weppos committed Jan 20, 2016
1 parent 2e50f70 commit 26ba278
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lib/dnsimple/struct/record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ class Record < Base
# @return [Fixnum] The record ID in DNSimple.
attr_accessor :id

# @return [Fixnum] The associated domain ID.
attr_accessor :domain_id
# @return [String] The associated zone ID.
attr_accessor :zone_id

# @return [Fixnum] The ID of the parent record, if this record is dependent on another record.
attr_accessor :parent_id
Expand Down
4 changes: 2 additions & 2 deletions spec/dnsimple/client/zones_records_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@

before do
stub_request(:get, %r[/v2/#{account_id}/zones/#{zone_id}/records/.+$])
.to_return(read_http_fixture("getRecord/success.http"))
.to_return(read_http_fixture("getZoneRecord/success.http"))
end

it "builds the correct request" do
Expand All @@ -141,7 +141,7 @@
result = response.data
expect(result).to be_a(Dnsimple::Struct::Record)
expect(result.id).to eq(64784)
expect(result.domain_id).to eq(5841)
expect(result.zone_id).to eq("example.com")
expect(result.parent_id).to eq(nil)
expect(result.type).to eq("A")
expect(result.name).to eq("www")
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures.http/createZoneRecord/created.http
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ X-Request-Id: f96f5034-bf0c-4201-9564-493c162e3cb4
X-Runtime: 0.099095
Strict-Transport-Security: max-age=31536000

{"data":{"id":64784,"domain_id":5841,"parent_id":null,"name":"www","content":"127.0.0.1","ttl":600,"priority":null,"type":"A","system_record":false,"created_at":"2016-01-07T17:45:13.653Z","updated_at":"2016-01-07T17:45:13.653Z"}}
{"data":{"id":64784,"zone_id":"example.com","parent_id":null,"name":"www","content":"127.0.0.1","ttl":600,"priority":null,"type":"A","system_record":false,"created_at":"2016-01-07T17:45:13.653Z","updated_at":"2016-01-07T17:45:13.653Z"}}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ X-Request-Id: 69258cd7-c9e6-4681-aed6-cb5bbdfbb156
X-Runtime: 0.048748
Strict-Transport-Security: max-age=31536000

{"data":{"id":64784,"domain_id":5841,"parent_id":null,"name":"www","content":"127.0.0.1","ttl":600,"priority":null,"type":"A","system_record":false,"created_at":"2016-01-07T17:45:13.653Z","updated_at":"2016-01-07T17:45:13.653Z"}}
{"data":{"id":64784,"zone_id":"example.com","parent_id":null,"name":"www","content":"127.0.0.1","ttl":600,"priority":null,"type":"A","system_record":false,"created_at":"2016-01-07T17:45:13.653Z","updated_at":"2016-01-07T17:45:13.653Z"}}
2 changes: 1 addition & 1 deletion spec/fixtures.http/listZoneRecords/success.http
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ X-Request-Id: 9b361b57-43e2-47df-9f00-e7c252bc4d41
X-Runtime: 0.107990
Strict-Transport-Security: max-age=31536000

{"data":[{"id":64779,"domain_id":5841,"parent_id":null,"name":"","content":"ns1.dnsimple.com admin.dnsimple.com 1452184205 86400 7200 604800 300","ttl":3600,"priority":null,"type":"SOA","system_record":true,"created_at":"2016-01-07T16:30:05.379Z","updated_at":"2016-01-07T16:30:05.379Z"},{"id":64780,"domain_id":5841,"parent_id":null,"name":"","content":"ns1.dnsimple.com","ttl":3600,"priority":null,"type":"NS","system_record":true,"created_at":"2016-01-07T16:30:05.422Z","updated_at":"2016-01-07T16:30:05.422Z"},{"id":64781,"domain_id":5841,"parent_id":null,"name":"","content":"ns2.dnsimple.com","ttl":3600,"priority":null,"type":"NS","system_record":true,"created_at":"2016-01-07T16:30:05.433Z","updated_at":"2016-01-07T16:30:05.433Z"},{"id":64782,"domain_id":5841,"parent_id":null,"name":"","content":"ns3.dnsimple.com","ttl":3600,"priority":null,"type":"NS","system_record":true,"created_at":"2016-01-07T16:30:05.445Z","updated_at":"2016-01-07T16:30:05.445Z"},{"id":64783,"domain_id":5841,"parent_id":null,"name":"","content":"ns4.dnsimple.com","ttl":3600,"priority":null,"type":"NS","system_record":true,"created_at":"2016-01-07T16:30:05.457Z","updated_at":"2016-01-07T16:30:05.457Z"}],"pagination":{"current_page":1,"per_page":30,"total_entries":5,"total_pages":1}}
{"data":[{"id":64779,"zone_id":"example.com","parent_id":null,"name":"","content":"ns1.dnsimple.com admin.dnsimple.com 1452184205 86400 7200 604800 300","ttl":3600,"priority":null,"type":"SOA","system_record":true,"created_at":"2016-01-07T16:30:05.379Z","updated_at":"2016-01-07T16:30:05.379Z"},{"id":64780,"zone_id":"example.com","parent_id":null,"name":"","content":"ns1.dnsimple.com","ttl":3600,"priority":null,"type":"NS","system_record":true,"created_at":"2016-01-07T16:30:05.422Z","updated_at":"2016-01-07T16:30:05.422Z"},{"id":64781,"zone_id":"example.com","parent_id":null,"name":"","content":"ns2.dnsimple.com","ttl":3600,"priority":null,"type":"NS","system_record":true,"created_at":"2016-01-07T16:30:05.433Z","updated_at":"2016-01-07T16:30:05.433Z"},{"id":64782,"zone_id":"example.com","parent_id":null,"name":"","content":"ns3.dnsimple.com","ttl":3600,"priority":null,"type":"NS","system_record":true,"created_at":"2016-01-07T16:30:05.445Z","updated_at":"2016-01-07T16:30:05.445Z"},{"id":64783,"zone_id":"example.com","parent_id":null,"name":"","content":"ns4.dnsimple.com","ttl":3600,"priority":null,"type":"NS","system_record":true,"created_at":"2016-01-07T16:30:05.457Z","updated_at":"2016-01-07T16:30:05.457Z"}],"pagination":{"current_page":1,"per_page":30,"total_entries":5,"total_pages":1}}
2 changes: 1 addition & 1 deletion spec/fixtures.http/register/success.http
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ X-Request-Id: 8b378ee7-d8fa-4459-a1b0-a18bfd2354bb
X-Runtime: 13.365767
Strict-Transport-Security: max-age=31536000

{"data":{"id":1,"account_id":1010,"registrant_id":2,"name":"example.weppos","unicode_name":"example.weppos","token":"cc8h1jP8bDLw5rXycL16k8BivcGiT6K9","state":"registered","auto_renew":false,"private_whois":false,"expires_on":"2017-01-16","created_at":"2016-01-16T16:08:50.649Z","updated_at":"2016-01-16T16:09:01.161Z"}}
{"data":{"id":1,"account_id":1010,"registrant_id":2,"name":"example.com","unicode_name":"example.com","token":"cc8h1jP8bDLw5rXycL16k8BivcGiT6K9","state":"registered","auto_renew":false,"private_whois":false,"expires_on":"2017-01-16","created_at":"2016-01-16T16:08:50.649Z","updated_at":"2016-01-16T16:09:01.161Z"}}

0 comments on commit 26ba278

Please sign in to comment.