dnsimple 4.2.0 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop_dnsimple.yml +128 -74
- data/.travis.yml +2 -2
- data/CHANGELOG.md +9 -0
- data/LICENSE.txt +1 -1
- data/README.md +1 -1
- data/dnsimple.gemspec +2 -2
- data/lib/dnsimple/client/certificates.rb +24 -0
- data/lib/dnsimple/client/registrar.rb +4 -4
- data/lib/dnsimple/version.rb +1 -1
- data/spec/dnsimple/client/accounts_spec.rb +4 -4
- data/spec/dnsimple/client/certificates_spec.rb +43 -22
- data/spec/dnsimple/client/client_service_spec.rb +6 -6
- data/spec/dnsimple/client/collaborators_spec.rb +20 -20
- data/spec/dnsimple/client/contacts_spec.rb +30 -30
- data/spec/dnsimple/client/domains_delegation_signer_records_spec.rb +25 -25
- data/spec/dnsimple/client/domains_dnssec_spec.rb +18 -18
- data/spec/dnsimple/client/domains_email_forwards_spec.rb +25 -25
- data/spec/dnsimple/client/domains_pushes_spec.rb +22 -22
- data/spec/dnsimple/client/domains_spec.rb +27 -27
- data/spec/dnsimple/client/identity_spec.rb +8 -8
- data/spec/dnsimple/client/oauth_spec.rb +8 -8
- data/spec/dnsimple/client/registrar_auto_renewal_spec.rb +12 -12
- data/spec/dnsimple/client/registrar_delegation_spec.rb +18 -18
- data/spec/dnsimple/client/registrar_spec.rb +37 -37
- data/spec/dnsimple/client/registrar_whois_privacy_spec.rb +16 -16
- data/spec/dnsimple/client/services_domains_spec.rb +13 -13
- data/spec/dnsimple/client/services_spec.rb +10 -10
- data/spec/dnsimple/client/templates_domains_spec.rb +4 -4
- data/spec/dnsimple/client/templates_records_spec.rb +25 -25
- data/spec/dnsimple/client/templates_spec.rb +26 -26
- data/spec/dnsimple/client/tlds_spec.rb +16 -16
- data/spec/dnsimple/client/vanity_name_servers_spec.rb +8 -8
- data/spec/dnsimple/client/webhooks_spec.rb +21 -21
- data/spec/dnsimple/client/zones_records_spec.rb +40 -40
- data/spec/dnsimple/client/zones_spec.rb +18 -18
- data/spec/dnsimple/client_spec.rb +25 -25
- metadata +3 -5
@@ -19,12 +19,12 @@ describe Dnsimple::Client::ClientService do
|
|
19
19
|
let(:account_id) { 1010 }
|
20
20
|
|
21
21
|
before do
|
22
|
-
stub_request(:get, %r{/v2/#{account_id}/list\?page=1&per_page=100})
|
23
|
-
to_return(read_http_fixture("pages-1of3.http"))
|
24
|
-
stub_request(:get, %r{/v2/#{account_id}/list\?page=2&per_page=100})
|
25
|
-
to_return(read_http_fixture("pages-2of3.http"))
|
26
|
-
stub_request(:get, %r{/v2/#{account_id}/list\?page=3&per_page=100})
|
27
|
-
to_return(read_http_fixture("pages-3of3.http"))
|
22
|
+
stub_request(:get, %r{/v2/#{account_id}/list\?page=1&per_page=100})
|
23
|
+
.to_return(read_http_fixture("pages-1of3.http"))
|
24
|
+
stub_request(:get, %r{/v2/#{account_id}/list\?page=2&per_page=100})
|
25
|
+
.to_return(read_http_fixture("pages-2of3.http"))
|
26
|
+
stub_request(:get, %r{/v2/#{account_id}/list\?page=3&per_page=100})
|
27
|
+
.to_return(read_http_fixture("pages-3of3.http"))
|
28
28
|
end
|
29
29
|
|
30
30
|
it "loops all the pages" do
|
@@ -10,15 +10,15 @@ describe Dnsimple::Client, ".domains" do
|
|
10
10
|
let(:domain_id) { "example.com" }
|
11
11
|
|
12
12
|
before do
|
13
|
-
stub_request(:get, %r{/v2/#{account_id}/domains/#{domain_id}/collaborators})
|
14
|
-
to_return(read_http_fixture("listCollaborators/success.http"))
|
13
|
+
stub_request(:get, %r{/v2/#{account_id}/domains/#{domain_id}/collaborators})
|
14
|
+
.to_return(read_http_fixture("listCollaborators/success.http"))
|
15
15
|
end
|
16
16
|
|
17
17
|
it "builds the correct request" do
|
18
18
|
subject.collaborators(account_id, domain_id)
|
19
19
|
|
20
|
-
expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/collaborators")
|
21
|
-
with(headers: { 'Accept' => 'application/json' })
|
20
|
+
expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/collaborators")
|
21
|
+
.with(headers: { 'Accept' => 'application/json' })
|
22
22
|
end
|
23
23
|
|
24
24
|
it "supports pagination" do
|
@@ -63,8 +63,8 @@ describe Dnsimple::Client, ".domains" do
|
|
63
63
|
|
64
64
|
context "invite user already registered on DNSimple" do
|
65
65
|
before do
|
66
|
-
stub_request(:post, %r{/v2/#{account_id}/domains/#{domain_id}/collaborators$})
|
67
|
-
to_return(read_http_fixture("addCollaborator/success.http"))
|
66
|
+
stub_request(:post, %r{/v2/#{account_id}/domains/#{domain_id}/collaborators$})
|
67
|
+
.to_return(read_http_fixture("addCollaborator/success.http"))
|
68
68
|
end
|
69
69
|
|
70
70
|
let(:attributes) { { email: "existing-user@example.com" } }
|
@@ -72,9 +72,9 @@ describe Dnsimple::Client, ".domains" do
|
|
72
72
|
it "builds the correct request" do
|
73
73
|
subject.add_collaborator(account_id, domain_id, attributes)
|
74
74
|
|
75
|
-
expect(WebMock).to have_requested(:post, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/collaborators")
|
76
|
-
with(body: attributes)
|
77
|
-
with(headers: { 'Accept' => 'application/json' })
|
75
|
+
expect(WebMock).to have_requested(:post, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/collaborators")
|
76
|
+
.with(body: attributes)
|
77
|
+
.with(headers: { 'Accept' => 'application/json' })
|
78
78
|
end
|
79
79
|
|
80
80
|
it "returns the contact" do
|
@@ -93,8 +93,8 @@ describe Dnsimple::Client, ".domains" do
|
|
93
93
|
|
94
94
|
context "invite not registered on DNSimple" do
|
95
95
|
before do
|
96
|
-
stub_request(:post, %r{/v2/#{account_id}/domains/#{domain_id}/collaborators$})
|
97
|
-
to_return(read_http_fixture("addCollaborator/invite-success.http"))
|
96
|
+
stub_request(:post, %r{/v2/#{account_id}/domains/#{domain_id}/collaborators$})
|
97
|
+
.to_return(read_http_fixture("addCollaborator/invite-success.http"))
|
98
98
|
end
|
99
99
|
|
100
100
|
let(:attributes) { { email: "invited-user@example.com" } }
|
@@ -102,9 +102,9 @@ describe Dnsimple::Client, ".domains" do
|
|
102
102
|
it "builds the correct request" do
|
103
103
|
subject.add_collaborator(account_id, domain_id, attributes)
|
104
104
|
|
105
|
-
expect(WebMock).to have_requested(:post, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/collaborators")
|
106
|
-
with(body: attributes)
|
107
|
-
with(headers: { 'Accept' => 'application/json' })
|
105
|
+
expect(WebMock).to have_requested(:post, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/collaborators")
|
106
|
+
.with(body: attributes)
|
107
|
+
.with(headers: { 'Accept' => 'application/json' })
|
108
108
|
end
|
109
109
|
|
110
110
|
it "returns the contact" do
|
@@ -128,15 +128,15 @@ describe Dnsimple::Client, ".domains" do
|
|
128
128
|
let(:collaborator_id) { 100 }
|
129
129
|
|
130
130
|
before do
|
131
|
-
stub_request(:delete, %r{/v2/#{account_id}/domains/#{domain_id}/collaborators/.+$})
|
132
|
-
to_return(read_http_fixture("removeCollaborator/success.http"))
|
131
|
+
stub_request(:delete, %r{/v2/#{account_id}/domains/#{domain_id}/collaborators/.+$})
|
132
|
+
.to_return(read_http_fixture("removeCollaborator/success.http"))
|
133
133
|
end
|
134
134
|
|
135
135
|
it "builds the correct request" do
|
136
136
|
subject.remove_collaborator(account_id, domain_id, collaborator_id)
|
137
137
|
|
138
|
-
expect(WebMock).to have_requested(:delete, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/collaborators/#{collaborator_id}")
|
139
|
-
with(headers: { 'Accept' => 'application/json' })
|
138
|
+
expect(WebMock).to have_requested(:delete, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/collaborators/#{collaborator_id}")
|
139
|
+
.with(headers: { 'Accept' => 'application/json' })
|
140
140
|
end
|
141
141
|
|
142
142
|
it "returns nothing" do
|
@@ -149,8 +149,8 @@ describe Dnsimple::Client, ".domains" do
|
|
149
149
|
|
150
150
|
context "when the collaborator does not exist" do
|
151
151
|
it "raises NotFoundError" do
|
152
|
-
stub_request(:delete, %r{/v2})
|
153
|
-
to_return(read_http_fixture("notfound-collaborator.http"))
|
152
|
+
stub_request(:delete, %r{/v2})
|
153
|
+
.to_return(read_http_fixture("notfound-collaborator.http"))
|
154
154
|
|
155
155
|
expect {
|
156
156
|
subject.remove_collaborator(account_id, domain_id, collaborator_id)
|
@@ -9,15 +9,15 @@ describe Dnsimple::Client, ".contacts" do
|
|
9
9
|
let(:account_id) { 1010 }
|
10
10
|
|
11
11
|
before do
|
12
|
-
stub_request(:get, %r{/v2/#{account_id}/contacts})
|
13
|
-
to_return(read_http_fixture("listContacts/success.http"))
|
12
|
+
stub_request(:get, %r{/v2/#{account_id}/contacts})
|
13
|
+
.to_return(read_http_fixture("listContacts/success.http"))
|
14
14
|
end
|
15
15
|
|
16
16
|
it "builds the correct request" do
|
17
17
|
subject.contacts(account_id)
|
18
18
|
|
19
|
-
expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/contacts")
|
20
|
-
with(headers: { 'Accept' => 'application/json' })
|
19
|
+
expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/contacts")
|
20
|
+
.with(headers: { 'Accept' => 'application/json' })
|
21
21
|
end
|
22
22
|
|
23
23
|
it "supports pagination" do
|
@@ -64,8 +64,8 @@ describe Dnsimple::Client, ".contacts" do
|
|
64
64
|
|
65
65
|
describe "#all_contacts" do
|
66
66
|
before do
|
67
|
-
stub_request(:get, %r{/v2/#{account_id}/contacts})
|
68
|
-
to_return(read_http_fixture("listContacts/success.http"))
|
67
|
+
stub_request(:get, %r{/v2/#{account_id}/contacts})
|
68
|
+
.to_return(read_http_fixture("listContacts/success.http"))
|
69
69
|
end
|
70
70
|
|
71
71
|
let(:account_id) { 1010 }
|
@@ -86,8 +86,8 @@ describe Dnsimple::Client, ".contacts" do
|
|
86
86
|
let(:account_id) { 1010 }
|
87
87
|
|
88
88
|
before do
|
89
|
-
stub_request(:post, %r{/v2/#{account_id}/contacts$})
|
90
|
-
to_return(read_http_fixture("createContact/created.http"))
|
89
|
+
stub_request(:post, %r{/v2/#{account_id}/contacts$})
|
90
|
+
.to_return(read_http_fixture("createContact/created.http"))
|
91
91
|
end
|
92
92
|
|
93
93
|
let(:attributes) { { first_name: "Simone", last_name: "Carletti", address1: "Italian Street", city: "Rome", state_province: "RM", postal_code: "00171", country: "IT", email: "example@example.com", phone: "+393391234567" } }
|
@@ -95,9 +95,9 @@ describe Dnsimple::Client, ".contacts" do
|
|
95
95
|
it "builds the correct request" do
|
96
96
|
subject.create_contact(account_id, attributes)
|
97
97
|
|
98
|
-
expect(WebMock).to have_requested(:post, "https://api.dnsimple.test/v2/#{account_id}/contacts")
|
99
|
-
with(body: attributes)
|
100
|
-
with(headers: { 'Accept' => 'application/json' })
|
98
|
+
expect(WebMock).to have_requested(:post, "https://api.dnsimple.test/v2/#{account_id}/contacts")
|
99
|
+
.with(body: attributes)
|
100
|
+
.with(headers: { 'Accept' => 'application/json' })
|
101
101
|
end
|
102
102
|
|
103
103
|
it "returns the contact" do
|
@@ -114,15 +114,15 @@ describe Dnsimple::Client, ".contacts" do
|
|
114
114
|
let(:account_id) { 1010 }
|
115
115
|
|
116
116
|
before do
|
117
|
-
stub_request(:get, %r{/v2/#{account_id}/contacts/.+$})
|
118
|
-
to_return(read_http_fixture("getContact/success.http"))
|
117
|
+
stub_request(:get, %r{/v2/#{account_id}/contacts/.+$})
|
118
|
+
.to_return(read_http_fixture("getContact/success.http"))
|
119
119
|
end
|
120
120
|
|
121
121
|
it "builds the correct request" do
|
122
122
|
subject.contact(account_id, contact = 1)
|
123
123
|
|
124
|
-
expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/contacts/#{contact}")
|
125
|
-
with(headers: { 'Accept' => 'application/json' })
|
124
|
+
expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/contacts/#{contact}")
|
125
|
+
.with(headers: { 'Accept' => 'application/json' })
|
126
126
|
end
|
127
127
|
|
128
128
|
it "returns the contact" do
|
@@ -139,8 +139,8 @@ describe Dnsimple::Client, ".contacts" do
|
|
139
139
|
|
140
140
|
context "when the contact does not exist" do
|
141
141
|
it "raises NotFoundError" do
|
142
|
-
stub_request(:get, %r{/v2})
|
143
|
-
to_return(read_http_fixture("notfound-contact.http"))
|
142
|
+
stub_request(:get, %r{/v2})
|
143
|
+
.to_return(read_http_fixture("notfound-contact.http"))
|
144
144
|
|
145
145
|
expect {
|
146
146
|
subject.contact(account_id, 0)
|
@@ -153,8 +153,8 @@ describe Dnsimple::Client, ".contacts" do
|
|
153
153
|
let(:account_id) { 1010 }
|
154
154
|
|
155
155
|
before do
|
156
|
-
stub_request(:patch, %r{/v2/#{account_id}/contacts/.+$})
|
157
|
-
to_return(read_http_fixture("updateContact/success.http"))
|
156
|
+
stub_request(:patch, %r{/v2/#{account_id}/contacts/.+$})
|
157
|
+
.to_return(read_http_fixture("updateContact/success.http"))
|
158
158
|
end
|
159
159
|
|
160
160
|
let(:attributes) { { first_name: "Updated" } }
|
@@ -162,9 +162,9 @@ describe Dnsimple::Client, ".contacts" do
|
|
162
162
|
it "builds the correct request" do
|
163
163
|
subject.update_contact(account_id, contact_id = 1, attributes)
|
164
164
|
|
165
|
-
expect(WebMock).to have_requested(:patch, "https://api.dnsimple.test/v2/#{account_id}/contacts/#{contact_id}")
|
166
|
-
with(body: attributes)
|
167
|
-
with(headers: { 'Accept' => 'application/json' })
|
165
|
+
expect(WebMock).to have_requested(:patch, "https://api.dnsimple.test/v2/#{account_id}/contacts/#{contact_id}")
|
166
|
+
.with(body: attributes)
|
167
|
+
.with(headers: { 'Accept' => 'application/json' })
|
168
168
|
end
|
169
169
|
|
170
170
|
it "returns the contact" do
|
@@ -178,8 +178,8 @@ describe Dnsimple::Client, ".contacts" do
|
|
178
178
|
|
179
179
|
context "when the contact does not exist" do
|
180
180
|
it "raises NotFoundError" do
|
181
|
-
stub_request(:patch, %r{/v2})
|
182
|
-
to_return(read_http_fixture("notfound-contact.http"))
|
181
|
+
stub_request(:patch, %r{/v2})
|
182
|
+
.to_return(read_http_fixture("notfound-contact.http"))
|
183
183
|
|
184
184
|
expect {
|
185
185
|
subject.update_contact(account_id, 0, {})
|
@@ -192,15 +192,15 @@ describe Dnsimple::Client, ".contacts" do
|
|
192
192
|
let(:account_id) { 1010 }
|
193
193
|
|
194
194
|
before do
|
195
|
-
stub_request(:delete, %r{/v2/#{account_id}/contacts/.+$})
|
196
|
-
to_return(read_http_fixture("deleteContact/success.http"))
|
195
|
+
stub_request(:delete, %r{/v2/#{account_id}/contacts/.+$})
|
196
|
+
.to_return(read_http_fixture("deleteContact/success.http"))
|
197
197
|
end
|
198
198
|
|
199
199
|
it "builds the correct request" do
|
200
200
|
subject.delete_contact(account_id, domain = "example.com")
|
201
201
|
|
202
|
-
expect(WebMock).to have_requested(:delete, "https://api.dnsimple.test/v2/#{account_id}/contacts/#{domain}")
|
203
|
-
with(headers: { 'Accept' => 'application/json' })
|
202
|
+
expect(WebMock).to have_requested(:delete, "https://api.dnsimple.test/v2/#{account_id}/contacts/#{domain}")
|
203
|
+
.with(headers: { 'Accept' => 'application/json' })
|
204
204
|
end
|
205
205
|
|
206
206
|
it "returns nothing" do
|
@@ -213,8 +213,8 @@ describe Dnsimple::Client, ".contacts" do
|
|
213
213
|
|
214
214
|
context "when the contact does not exist" do
|
215
215
|
it "raises NotFoundError" do
|
216
|
-
stub_request(:delete, %r{/v2})
|
217
|
-
to_return(read_http_fixture("notfound-contact.http"))
|
216
|
+
stub_request(:delete, %r{/v2})
|
217
|
+
.to_return(read_http_fixture("notfound-contact.http"))
|
218
218
|
|
219
219
|
expect {
|
220
220
|
subject.delete_contact(account_id, 0)
|
@@ -10,15 +10,15 @@ describe Dnsimple::Client, ".domains" do
|
|
10
10
|
let(:domain_id) { "example.com" }
|
11
11
|
|
12
12
|
before do
|
13
|
-
stub_request(:get, %r{/v2/#{account_id}/domains/#{domain_id}/ds_records})
|
14
|
-
to_return(read_http_fixture("listDelegationSignerRecords/success.http"))
|
13
|
+
stub_request(:get, %r{/v2/#{account_id}/domains/#{domain_id}/ds_records})
|
14
|
+
.to_return(read_http_fixture("listDelegationSignerRecords/success.http"))
|
15
15
|
end
|
16
16
|
|
17
17
|
it "builds the correct request" do
|
18
18
|
subject.delegation_signer_records(account_id, domain_id)
|
19
19
|
|
20
|
-
expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/ds_records")
|
21
|
-
with(headers: { 'Accept' => 'application/json' })
|
20
|
+
expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/ds_records")
|
21
|
+
.with(headers: { 'Accept' => 'application/json' })
|
22
22
|
end
|
23
23
|
|
24
24
|
it "supports pagination" do
|
@@ -64,8 +64,8 @@ describe Dnsimple::Client, ".domains" do
|
|
64
64
|
|
65
65
|
context "when the domain does not exist" do
|
66
66
|
it "raises NotFoundError" do
|
67
|
-
stub_request(:get, %r{/v2})
|
68
|
-
to_return(read_http_fixture("notfound-domain.http"))
|
67
|
+
stub_request(:get, %r{/v2})
|
68
|
+
.to_return(read_http_fixture("notfound-domain.http"))
|
69
69
|
|
70
70
|
expect {
|
71
71
|
subject.delegation_signer_records(account_id, domain_id)
|
@@ -76,8 +76,8 @@ describe Dnsimple::Client, ".domains" do
|
|
76
76
|
|
77
77
|
describe "#all_delegation_signer_records" do
|
78
78
|
before do
|
79
|
-
stub_request(:get, %r{/v2/#{account_id}/domains/#{domain_id}/ds_records})
|
80
|
-
to_return(read_http_fixture("listDelegationSignerRecords/success.http"))
|
79
|
+
stub_request(:get, %r{/v2/#{account_id}/domains/#{domain_id}/ds_records})
|
80
|
+
.to_return(read_http_fixture("listDelegationSignerRecords/success.http"))
|
81
81
|
end
|
82
82
|
|
83
83
|
let(:account_id) { 1010 }
|
@@ -100,8 +100,8 @@ describe Dnsimple::Client, ".domains" do
|
|
100
100
|
let(:domain_id) { "example.com" }
|
101
101
|
|
102
102
|
before do
|
103
|
-
stub_request(:post, %r{/v2/#{account_id}/domains/#{domain_id}/ds_records$})
|
104
|
-
to_return(read_http_fixture("createDelegationSignerRecord/created.http"))
|
103
|
+
stub_request(:post, %r{/v2/#{account_id}/domains/#{domain_id}/ds_records$})
|
104
|
+
.to_return(read_http_fixture("createDelegationSignerRecord/created.http"))
|
105
105
|
end
|
106
106
|
|
107
107
|
let(:attributes) { { algorithm: "13", digest: "ABC123", digest_type: "2", keytag: "1111" } }
|
@@ -109,9 +109,9 @@ describe Dnsimple::Client, ".domains" do
|
|
109
109
|
it "builds the correct request" do
|
110
110
|
subject.create_delegation_signer_record(account_id, domain_id, attributes)
|
111
111
|
|
112
|
-
expect(WebMock).to have_requested(:post, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/ds_records")
|
113
|
-
with(body: attributes)
|
114
|
-
with(headers: { 'Accept' => 'application/json' })
|
112
|
+
expect(WebMock).to have_requested(:post, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/ds_records")
|
113
|
+
.with(body: attributes)
|
114
|
+
.with(headers: { 'Accept' => 'application/json' })
|
115
115
|
end
|
116
116
|
|
117
117
|
it "returns the delegation signer record" do
|
@@ -130,15 +130,15 @@ describe Dnsimple::Client, ".domains" do
|
|
130
130
|
let(:ds_record_id) { 24 }
|
131
131
|
|
132
132
|
before do
|
133
|
-
stub_request(:get, %r{/v2/#{account_id}/domains/#{domain_id}/ds_records.+$})
|
134
|
-
to_return(read_http_fixture("getDelegationSignerRecord/success.http"))
|
133
|
+
stub_request(:get, %r{/v2/#{account_id}/domains/#{domain_id}/ds_records.+$})
|
134
|
+
.to_return(read_http_fixture("getDelegationSignerRecord/success.http"))
|
135
135
|
end
|
136
136
|
|
137
137
|
it "builds the correct request" do
|
138
138
|
subject.delegation_signer_record(account_id, domain_id, ds_record_id)
|
139
139
|
|
140
|
-
expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/ds_records/#{ds_record_id}")
|
141
|
-
with(headers: { 'Accept' => 'application/json' })
|
140
|
+
expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/ds_records/#{ds_record_id}")
|
141
|
+
.with(headers: { 'Accept' => 'application/json' })
|
142
142
|
end
|
143
143
|
|
144
144
|
it "returns the delegation signer record" do
|
@@ -159,8 +159,8 @@ describe Dnsimple::Client, ".domains" do
|
|
159
159
|
|
160
160
|
context "when the delegation signer record does not exist" do
|
161
161
|
it "raises NotFoundError" do
|
162
|
-
stub_request(:get, %r{/v2})
|
163
|
-
to_return(read_http_fixture("notfound-delegationsignerrecord.http"))
|
162
|
+
stub_request(:get, %r{/v2})
|
163
|
+
.to_return(read_http_fixture("notfound-delegationsignerrecord.http"))
|
164
164
|
|
165
165
|
expect {
|
166
166
|
subject.delegation_signer_record(account_id, domain_id, ds_record_id)
|
@@ -175,15 +175,15 @@ describe Dnsimple::Client, ".domains" do
|
|
175
175
|
let(:ds_record_id) { 1 }
|
176
176
|
|
177
177
|
before do
|
178
|
-
stub_request(:delete, %r{/v2/#{account_id}/domains/#{domain_id}/ds_records/#{ds_record_id}$})
|
179
|
-
to_return(read_http_fixture("deleteDelegationSignerRecord/success.http"))
|
178
|
+
stub_request(:delete, %r{/v2/#{account_id}/domains/#{domain_id}/ds_records/#{ds_record_id}$})
|
179
|
+
.to_return(read_http_fixture("deleteDelegationSignerRecord/success.http"))
|
180
180
|
end
|
181
181
|
|
182
182
|
it "builds the correct request" do
|
183
183
|
subject.delete_delegation_signer_record(account_id, domain_id, ds_record_id)
|
184
184
|
|
185
|
-
expect(WebMock).to have_requested(:delete, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/ds_records/#{ds_record_id}")
|
186
|
-
with(headers: { 'Accept' => 'application/json' })
|
185
|
+
expect(WebMock).to have_requested(:delete, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/ds_records/#{ds_record_id}")
|
186
|
+
.with(headers: { 'Accept' => 'application/json' })
|
187
187
|
end
|
188
188
|
|
189
189
|
it "returns nothing" do
|
@@ -196,8 +196,8 @@ describe Dnsimple::Client, ".domains" do
|
|
196
196
|
|
197
197
|
context "when the delegation signer record does not exist" do
|
198
198
|
it "raises NotFoundError" do
|
199
|
-
stub_request(:delete, %r{/v2})
|
200
|
-
to_return(read_http_fixture("notfound-delegationsignerrecord.http"))
|
199
|
+
stub_request(:delete, %r{/v2})
|
200
|
+
.to_return(read_http_fixture("notfound-delegationsignerrecord.http"))
|
201
201
|
|
202
202
|
expect {
|
203
203
|
subject.delete_delegation_signer_record(account_id, domain_id, ds_record_id)
|
@@ -9,16 +9,16 @@ describe Dnsimple::Client, ".domains" do
|
|
9
9
|
let(:domain_id) { "example.com" }
|
10
10
|
|
11
11
|
before do
|
12
|
-
stub_request(:post, %r{/v2/#{account_id}/domains/#{domain_id}/dnssec})
|
13
|
-
to_return(read_http_fixture("enableDnssec/success.http"))
|
12
|
+
stub_request(:post, %r{/v2/#{account_id}/domains/#{domain_id}/dnssec})
|
13
|
+
.to_return(read_http_fixture("enableDnssec/success.http"))
|
14
14
|
end
|
15
15
|
|
16
16
|
|
17
17
|
it "builds the correct request" do
|
18
18
|
subject.enable_dnssec(account_id, domain_id)
|
19
19
|
|
20
|
-
expect(WebMock).to have_requested(:post, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/dnssec")
|
21
|
-
with(headers: { 'Accept' => 'application/json' })
|
20
|
+
expect(WebMock).to have_requested(:post, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/dnssec")
|
21
|
+
.with(headers: { 'Accept' => 'application/json' })
|
22
22
|
end
|
23
23
|
|
24
24
|
it "returns the dnssec status" do
|
@@ -32,8 +32,8 @@ describe Dnsimple::Client, ".domains" do
|
|
32
32
|
|
33
33
|
context "when the domain does not exist" do
|
34
34
|
it "raises NotFoundError" do
|
35
|
-
stub_request(:post, %r{/v2})
|
36
|
-
to_return(read_http_fixture("notfound-domain.http"))
|
35
|
+
stub_request(:post, %r{/v2})
|
36
|
+
.to_return(read_http_fixture("notfound-domain.http"))
|
37
37
|
|
38
38
|
expect {
|
39
39
|
subject.enable_dnssec(account_id, domain_id)
|
@@ -48,16 +48,16 @@ describe Dnsimple::Client, ".domains" do
|
|
48
48
|
let(:domain_id) { "example.com" }
|
49
49
|
|
50
50
|
before do
|
51
|
-
stub_request(:delete, %r{/v2/#{account_id}/domains/#{domain_id}/dnssec})
|
52
|
-
to_return(read_http_fixture("disableDnssec/success.http"))
|
51
|
+
stub_request(:delete, %r{/v2/#{account_id}/domains/#{domain_id}/dnssec})
|
52
|
+
.to_return(read_http_fixture("disableDnssec/success.http"))
|
53
53
|
end
|
54
54
|
|
55
55
|
|
56
56
|
it "builds the correct request" do
|
57
57
|
subject.disable_dnssec(account_id, domain_id)
|
58
58
|
|
59
|
-
expect(WebMock).to have_requested(:delete, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/dnssec")
|
60
|
-
with(headers: { 'Accept' => 'application/json' })
|
59
|
+
expect(WebMock).to have_requested(:delete, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/dnssec")
|
60
|
+
.with(headers: { 'Accept' => 'application/json' })
|
61
61
|
end
|
62
62
|
|
63
63
|
it "returns nothing" do
|
@@ -70,8 +70,8 @@ describe Dnsimple::Client, ".domains" do
|
|
70
70
|
|
71
71
|
context "when the domain does not exist" do
|
72
72
|
it "raises NotFoundError" do
|
73
|
-
stub_request(:delete, %r{/v2})
|
74
|
-
to_return(read_http_fixture("notfound-domain.http"))
|
73
|
+
stub_request(:delete, %r{/v2})
|
74
|
+
.to_return(read_http_fixture("notfound-domain.http"))
|
75
75
|
|
76
76
|
expect {
|
77
77
|
subject.disable_dnssec(account_id, domain_id)
|
@@ -85,16 +85,16 @@ describe Dnsimple::Client, ".domains" do
|
|
85
85
|
let(:domain_id) { "example.com" }
|
86
86
|
|
87
87
|
before do
|
88
|
-
stub_request(:get, %r{/v2/#{account_id}/domains/#{domain_id}/dnssec})
|
89
|
-
to_return(read_http_fixture("getDnssec/success.http"))
|
88
|
+
stub_request(:get, %r{/v2/#{account_id}/domains/#{domain_id}/dnssec})
|
89
|
+
.to_return(read_http_fixture("getDnssec/success.http"))
|
90
90
|
end
|
91
91
|
|
92
92
|
|
93
93
|
it "builds the correct request" do
|
94
94
|
subject.get_dnssec(account_id, domain_id)
|
95
95
|
|
96
|
-
expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/dnssec")
|
97
|
-
with(headers: { 'Accept' => 'application/json' })
|
96
|
+
expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/dnssec")
|
97
|
+
.with(headers: { 'Accept' => 'application/json' })
|
98
98
|
end
|
99
99
|
|
100
100
|
it "returns the dnssec status" do
|
@@ -108,8 +108,8 @@ describe Dnsimple::Client, ".domains" do
|
|
108
108
|
|
109
109
|
context "when the domain does not exist" do
|
110
110
|
it "raises NotFoundError" do
|
111
|
-
stub_request(:get, %r{/v2})
|
112
|
-
to_return(read_http_fixture("notfound-domain.http"))
|
111
|
+
stub_request(:get, %r{/v2})
|
112
|
+
.to_return(read_http_fixture("notfound-domain.http"))
|
113
113
|
|
114
114
|
expect {
|
115
115
|
subject.get_dnssec(account_id, domain_id)
|