dnsimple 10.0.0 → 11.0.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.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +5 -7
  3. data/.github/workflows/ci.yml +3 -3
  4. data/.github/workflows/release.yml +2 -2
  5. data/.github/workflows/sync-test-fixtures.yml +55 -0
  6. data/.markdownlint.yaml +15 -1
  7. data/.rubocop.yml +1 -1
  8. data/.rubocop_dnsimple.yml +14 -30
  9. data/CHANGELOG.md +5 -0
  10. data/Gemfile +7 -7
  11. data/lib/dnsimple/client/clients.rb +29 -31
  12. data/lib/dnsimple/client/domains_email_forwards.rb +1 -1
  13. data/lib/dnsimple/client.rb +5 -5
  14. data/lib/dnsimple/default.rb +7 -7
  15. data/lib/dnsimple/response.rb +3 -3
  16. data/lib/dnsimple/struct/charge.rb +1 -1
  17. data/lib/dnsimple/struct/email_forward.rb +0 -8
  18. data/lib/dnsimple/struct.rb +40 -40
  19. data/lib/dnsimple/version.rb +1 -1
  20. data/lib/dnsimple.rb +5 -5
  21. data/spec/dnsimple/client/accounts_spec.rb +2 -2
  22. data/spec/dnsimple/client/billing_spec.rb +3 -3
  23. data/spec/dnsimple/client/certificates_spec.rb +11 -11
  24. data/spec/dnsimple/client/client_service_spec.rb +1 -1
  25. data/spec/dnsimple/client/contacts_spec.rb +6 -6
  26. data/spec/dnsimple/client/dns_analytics_spec.rb +9 -9
  27. data/spec/dnsimple/client/domains_delegation_signer_records_spec.rb +5 -5
  28. data/spec/dnsimple/client/domains_dnssec_spec.rb +4 -4
  29. data/spec/dnsimple/client/domains_email_forwards_spec.rb +8 -15
  30. data/spec/dnsimple/client/domains_pushes_spec.rb +5 -5
  31. data/spec/dnsimple/client/domains_spec.rb +6 -6
  32. data/spec/dnsimple/client/identity_spec.rb +2 -2
  33. data/spec/dnsimple/client/oauth_spec.rb +3 -3
  34. data/spec/dnsimple/client/registrar_auto_renewal_spec.rb +3 -3
  35. data/spec/dnsimple/client/registrar_delegation_spec.rb +1 -1
  36. data/spec/dnsimple/client/registrar_spec.rb +1 -1
  37. data/spec/dnsimple/client/registrar_transfer_lock_spec.rb +4 -4
  38. data/spec/dnsimple/client/registrar_whois_privacy_spec.rb +1 -1
  39. data/spec/dnsimple/client/services_domains_spec.rb +4 -4
  40. data/spec/dnsimple/client/services_spec.rb +1 -1
  41. data/spec/dnsimple/client/templates_domains_spec.rb +2 -2
  42. data/spec/dnsimple/client/templates_records_spec.rb +4 -4
  43. data/spec/dnsimple/client/templates_spec.rb +2 -2
  44. data/spec/dnsimple/client/tlds_spec.rb +5 -5
  45. data/spec/dnsimple/client/vanity_name_servers_spec.rb +1 -1
  46. data/spec/dnsimple/client/webhooks_spec.rb +5 -5
  47. data/spec/dnsimple/client/zones_distributions_spec.rb +3 -3
  48. data/spec/dnsimple/client/zones_records_spec.rb +7 -7
  49. data/spec/dnsimple/client/zones_spec.rb +6 -6
  50. data/spec/dnsimple/client_spec.rb +10 -10
  51. data/spec/dnsimple/extra_spec.rb +1 -1
  52. data/spec/dnsimple/options/base_spec.rb +5 -5
  53. data/spec/dnsimple/options/list_options_spec.rb +21 -21
  54. data/spec/fixtures.http/accounts/success-user.http +2 -1
  55. data/spec/fixtures.http/checkRegistrantChange/error-contactnotfound.http +4 -4
  56. data/spec/fixtures.http/checkRegistrantChange/error-domainnotfound.http +4 -4
  57. data/spec/fixtures.http/checkRegistrantChange/success.http +5 -5
  58. data/spec/fixtures.http/createContact/error-validation-errors.http +18 -0
  59. data/spec/fixtures.http/createEmailForward/created.http +1 -2
  60. data/spec/fixtures.http/createRegistrantChange/success.http +5 -5
  61. data/spec/fixtures.http/createWebhook/created.http +16 -16
  62. data/spec/fixtures.http/deleteRegistrantChange/success.http +4 -4
  63. data/spec/fixtures.http/deleteRegistrantChange/success_async.http +14 -0
  64. data/spec/fixtures.http/dnsAnalytics/success.http +1 -1
  65. data/spec/fixtures.http/getDomainPrices/failure.http +18 -18
  66. data/spec/fixtures.http/getDomainPrices/success.http +21 -21
  67. data/spec/fixtures.http/getDomainRestore/success.http +13 -14
  68. data/spec/fixtures.http/getEmailForward/success.http +1 -2
  69. data/spec/fixtures.http/getRegistrantChange/success.http +5 -5
  70. data/spec/fixtures.http/getTld/success.http +1 -1
  71. data/spec/fixtures.http/getWebhook/success.http +16 -16
  72. data/spec/fixtures.http/listAccounts/success-user.http +1 -1
  73. data/spec/fixtures.http/listCharges/fail-400-bad-filter.http +0 -2
  74. data/spec/fixtures.http/listCharges/fail-403.http +0 -2
  75. data/spec/fixtures.http/listCharges/success.http +0 -2
  76. data/spec/fixtures.http/listEmailForwards/success.http +1 -1
  77. data/spec/fixtures.http/listRegistrantChanges/success.http +5 -5
  78. data/spec/fixtures.http/listTlds/success.http +1 -1
  79. data/spec/fixtures.http/listWebhooks/success.http +16 -16
  80. data/spec/fixtures.http/registerDomain/error-extended-attributes.http +18 -0
  81. data/spec/fixtures.http/restoreDomain/success.http +12 -13
  82. data/spec/fixtures.http/updateZoneNsRecords/success.http +16 -0
  83. data/spec/fixtures.http/whoami/success-account.http +1 -1
  84. data/spec/fixtures.http/whoami/success.http +1 -1
  85. data/spec/spec_helper.rb +4 -4
  86. data/spec/support/webmock.rb +1 -1
  87. metadata +7 -11
  88. data/.github/CODEOWNERS +0 -1
  89. data/.github/workflows/auto-merge.yml +0 -32
  90. data/lib/dnsimple/client/domains_collaborators.rb +0 -87
  91. data/spec/dnsimple/client/domains_collaborators_spec.rb +0 -164
  92. data/spec/fixtures.http/addCollaborator/invite-success.http +0 -20
  93. data/spec/fixtures.http/addCollaborator/success.http +0 -20
  94. data/spec/fixtures.http/listCollaborators/success.http +0 -20
  95. data/spec/fixtures.http/notfound-collaborator.http +0 -15
  96. data/spec/fixtures.http/removeCollaborator/success.http +0 -17
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spec_helper'
3
+ require "spec_helper"
4
4
 
5
5
  describe Dnsimple::Client, ".registrar" do
6
6
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spec_helper'
3
+ require "spec_helper"
4
4
 
5
5
  describe Dnsimple::Client, ".services" do
6
6
 
@@ -9,7 +9,7 @@ describe Dnsimple::Client, ".services" do
9
9
 
10
10
  describe "#applied_services" do
11
11
  let(:account_id) { 1010 }
12
- let(:domain_id) { 'example.com' }
12
+ let(:domain_id) { "example.com" }
13
13
 
14
14
  before do
15
15
  stub_request(:get, %r{/v2/#{account_id}/domains/#{domain_id}/services})
@@ -74,7 +74,7 @@ describe Dnsimple::Client, ".services" do
74
74
 
75
75
  expect(WebMock).to have_requested(:post, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/services/#{service_id}")
76
76
  .with(body: settings)
77
- .with(headers: { 'Accept' => 'application/json' })
77
+ .with(headers: { "Accept" => "application/json" })
78
78
  end
79
79
 
80
80
  it "returns empty response" do
@@ -100,7 +100,7 @@ describe Dnsimple::Client, ".services" do
100
100
  subject.unapply_service(account_id, service_id, domain_id)
101
101
 
102
102
  expect(WebMock).to have_requested(:delete, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/services/#{service_id}")
103
- .with(headers: { 'Accept' => 'application/json' })
103
+ .with(headers: { "Accept" => "application/json" })
104
104
  end
105
105
 
106
106
  it "returns empty response" do
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spec_helper'
3
+ require "spec_helper"
4
4
 
5
5
  describe Dnsimple::Client, ".services" do
6
6
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spec_helper'
3
+ require "spec_helper"
4
4
 
5
5
  describe Dnsimple::Client, ".templates" do
6
6
 
@@ -10,7 +10,7 @@ describe Dnsimple::Client, ".templates" do
10
10
  describe "#apply_template" do
11
11
  let(:account_id) { 1010 }
12
12
  let(:template_id) { 5410 }
13
- let(:domain_id) { 'example.com' }
13
+ let(:domain_id) { "example.com" }
14
14
 
15
15
  before do
16
16
  stub_request(:post, %r{/v2/#{account_id}/domains/#{domain_id}/templates/#{template_id}$})
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spec_helper'
3
+ require "spec_helper"
4
4
 
5
5
  describe Dnsimple::Client, ".templates" do
6
6
 
@@ -92,7 +92,7 @@ describe Dnsimple::Client, ".templates" do
92
92
 
93
93
  expect(WebMock).to have_requested(:post, "https://api.dnsimple.test/v2/#{account_id}/templates/#{template_id}/records")
94
94
  .with(body: attributes)
95
- .with(headers: { 'Accept' => 'application/json' })
95
+ .with(headers: { "Accept" => "application/json" })
96
96
  end
97
97
 
98
98
  it "returns the record" do
@@ -157,7 +157,7 @@ describe Dnsimple::Client, ".templates" do
157
157
  subject.record(account_id, template_id, record_id = 301)
158
158
 
159
159
  expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/templates/#{template_id}/records/#{record_id}")
160
- .with(headers: { 'Accept' => 'application/json' })
160
+ .with(headers: { "Accept" => "application/json" })
161
161
  end
162
162
 
163
163
  it "returns the record" do
@@ -191,7 +191,7 @@ describe Dnsimple::Client, ".templates" do
191
191
  subject.delete_record(account_id, template_id, record_id = 301)
192
192
 
193
193
  expect(WebMock).to have_requested(:delete, "https://api.dnsimple.test/v2/#{account_id}/templates/#{template_id}/records/#{record_id}")
194
- .with(headers: { 'Accept' => 'application/json' })
194
+ .with(headers: { "Accept" => "application/json" })
195
195
  end
196
196
 
197
197
  it "returns nothing" do
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spec_helper'
3
+ require "spec_helper"
4
4
 
5
5
  describe Dnsimple::Client, ".templates" do
6
6
 
@@ -194,7 +194,7 @@ describe Dnsimple::Client, ".templates" do
194
194
  describe "#apply_template" do
195
195
  let(:account_id) { 1010 }
196
196
  let(:template_id) { 5410 }
197
- let(:domain_id) { 'example.com' }
197
+ let(:domain_id) { "example.com" }
198
198
 
199
199
  before do
200
200
  stub_request(:post, %r{/v2/#{account_id}/domains/#{domain_id}/templates/#{template_id}$})
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spec_helper'
3
+ require "spec_helper"
4
4
 
5
5
  describe Dnsimple::Client, ".tlds" do
6
6
  subject { described_class.new(base_url: "https://api.dnsimple.test", access_token: "a1b2c3").tlds }
@@ -15,7 +15,7 @@ describe Dnsimple::Client, ".tlds" do
15
15
  subject.list_tlds
16
16
 
17
17
  expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/tlds")
18
- .with(headers: { 'Accept' => 'application/json' })
18
+ .with(headers: { "Accept" => "application/json" })
19
19
  end
20
20
 
21
21
  it "supports pagination" do
@@ -89,7 +89,7 @@ describe Dnsimple::Client, ".tlds" do
89
89
  subject.tld(tld = "com")
90
90
 
91
91
  expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/tlds/#{tld}")
92
- .with(headers: { 'Accept' => 'application/json' })
92
+ .with(headers: { "Accept" => "application/json" })
93
93
  end
94
94
 
95
95
  it "returns the tld" do
@@ -98,7 +98,7 @@ describe Dnsimple::Client, ".tlds" do
98
98
 
99
99
  result = response.data
100
100
  expect(result).to be_a(Dnsimple::Struct::Tld)
101
- expect(result.tld).to eq('com')
101
+ expect(result.tld).to eq("com")
102
102
  expect(result.tld_type).to eq(1)
103
103
  expect(result.whois_privacy).to be(true)
104
104
  expect(result.auto_renew_only).to be(false)
@@ -121,7 +121,7 @@ describe Dnsimple::Client, ".tlds" do
121
121
  subject.tld_extended_attributes(tld = "uk")
122
122
 
123
123
  expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/tlds/#{tld}/extended_attributes")
124
- .with(headers: { 'Accept' => 'application/json' })
124
+ .with(headers: { "Accept" => "application/json" })
125
125
  end
126
126
 
127
127
  it "returns the extended attributes" do
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spec_helper'
3
+ require "spec_helper"
4
4
 
5
5
  describe Dnsimple::Client, ".vanity_name_servers" do
6
6
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spec_helper'
3
+ require "spec_helper"
4
4
 
5
5
  describe Dnsimple::Client, ".webhooks" do
6
6
 
@@ -18,7 +18,7 @@ describe Dnsimple::Client, ".webhooks" do
18
18
  subject.webhooks(account_id)
19
19
 
20
20
  expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/webhooks")
21
- .with(headers: { 'Accept' => 'application/json' })
21
+ .with(headers: { "Accept" => "application/json" })
22
22
  end
23
23
 
24
24
  it "supports extra request options" do
@@ -62,7 +62,7 @@ describe Dnsimple::Client, ".webhooks" do
62
62
 
63
63
  expect(WebMock).to have_requested(:post, "https://api.dnsimple.test/v2/#{account_id}/webhooks")
64
64
  .with(body: attributes)
65
- .with(headers: { 'Accept' => 'application/json' })
65
+ .with(headers: { "Accept" => "application/json" })
66
66
  end
67
67
 
68
68
  it "returns the webhook" do
@@ -87,7 +87,7 @@ describe Dnsimple::Client, ".webhooks" do
87
87
  subject.webhook(account_id, webhook_id = "1")
88
88
 
89
89
  expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/webhooks/#{webhook_id}")
90
- .with(headers: { 'Accept' => 'application/json' })
90
+ .with(headers: { "Accept" => "application/json" })
91
91
  end
92
92
 
93
93
  it "returns the webhook" do
@@ -124,7 +124,7 @@ describe Dnsimple::Client, ".webhooks" do
124
124
  subject.delete_webhook(account_id, webhook_id = "1")
125
125
 
126
126
  expect(WebMock).to have_requested(:delete, "https://api.dnsimple.test/v2/#{account_id}/webhooks/#{webhook_id}")
127
- .with(headers: { 'Accept' => 'application/json' })
127
+ .with(headers: { "Accept" => "application/json" })
128
128
  end
129
129
 
130
130
  it "returns nothing" do
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spec_helper'
3
+ require "spec_helper"
4
4
 
5
5
  describe Dnsimple::Client, ".zones" do
6
6
 
@@ -18,7 +18,7 @@ describe Dnsimple::Client, ".zones" do
18
18
  subject.zone_distribution(account_id, zone = "example.com")
19
19
 
20
20
  expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/zones/#{zone}/distribution")
21
- .with(headers: { 'Accept' => 'application/json' })
21
+ .with(headers: { "Accept" => "application/json" })
22
22
  end
23
23
 
24
24
  it "returns the zone distribution check with true when the zone is fully distributed" do
@@ -78,7 +78,7 @@ describe Dnsimple::Client, ".zones" do
78
78
  subject.zone_record_distribution(account_id, zone_id, record_id)
79
79
 
80
80
  expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/zones/#{zone_id}/records/#{record_id}/distribution")
81
- .with(headers: { 'Accept' => 'application/json' })
81
+ .with(headers: { "Accept" => "application/json" })
82
82
  end
83
83
 
84
84
  it "returns the zone record distribution check with true when the zone is fully distributed" do
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spec_helper'
3
+ require "spec_helper"
4
4
 
5
5
  describe Dnsimple::Client, ".zones" do
6
6
 
@@ -20,7 +20,7 @@ describe Dnsimple::Client, ".zones" do
20
20
  subject.list_zone_records(account_id, zone_id)
21
21
 
22
22
  expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/zones/#{zone_id}/records")
23
- .with(headers: { 'Accept' => 'application/json' })
23
+ .with(headers: { "Accept" => "application/json" })
24
24
  end
25
25
 
26
26
  it "supports pagination" do
@@ -126,7 +126,7 @@ describe Dnsimple::Client, ".zones" do
126
126
 
127
127
  expect(WebMock).to have_requested(:post, "https://api.dnsimple.test/v2/#{account_id}/zones/#{zone_id}/records")
128
128
  .with(body: attributes)
129
- .with(headers: { 'Accept' => 'application/json' })
129
+ .with(headers: { "Accept" => "application/json" })
130
130
  end
131
131
 
132
132
  it "returns the record" do
@@ -168,7 +168,7 @@ describe Dnsimple::Client, ".zones" do
168
168
  subject.zone_record(account_id, zone_id, record_id)
169
169
 
170
170
  expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/zones/#{zone_id}/records/#{record_id}")
171
- .with(headers: { 'Accept' => 'application/json' })
171
+ .with(headers: { "Accept" => "application/json" })
172
172
  end
173
173
 
174
174
  it "returns the record" do
@@ -216,7 +216,7 @@ describe Dnsimple::Client, ".zones" do
216
216
 
217
217
  describe "#update_zone_record" do
218
218
  let(:account_id) { 1010 }
219
- let(:attributes) { { content: "mxb.example.com", priority: "20", regions: ['global'] } }
219
+ let(:attributes) { { content: "mxb.example.com", priority: "20", regions: ["global"] } }
220
220
  let(:zone_id) { "example.com" }
221
221
  let(:record_id) { 5 }
222
222
 
@@ -231,7 +231,7 @@ describe Dnsimple::Client, ".zones" do
231
231
 
232
232
  expect(WebMock).to have_requested(:patch, "https://api.dnsimple.test/v2/#{account_id}/zones/#{zone_id}/records/#{record_id}")
233
233
  .with(body: attributes)
234
- .with(headers: { 'Accept' => 'application/json' })
234
+ .with(headers: { "Accept" => "application/json" })
235
235
  end
236
236
 
237
237
  it "returns the record" do
@@ -282,7 +282,7 @@ describe Dnsimple::Client, ".zones" do
282
282
  subject.delete_zone_record(account_id, zone_id, record_id = 2)
283
283
 
284
284
  expect(WebMock).to have_requested(:delete, "https://api.dnsimple.test/v2/#{account_id}/zones/#{zone_id}/records/#{record_id}")
285
- .with(headers: { 'Accept' => 'application/json' })
285
+ .with(headers: { "Accept" => "application/json" })
286
286
  end
287
287
 
288
288
  it "returns nothing" do
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spec_helper'
3
+ require "spec_helper"
4
4
 
5
5
  describe Dnsimple::Client, ".zones" do
6
6
  subject { described_class.new(base_url: "https://api.dnsimple.test", access_token: "a1b2c3").zones }
@@ -18,7 +18,7 @@ describe Dnsimple::Client, ".zones" do
18
18
  subject.zones(account_id)
19
19
 
20
20
  expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/zones")
21
- .with(headers: { 'Accept' => 'application/json' })
21
+ .with(headers: { "Accept" => "application/json" })
22
22
  end
23
23
 
24
24
  it "supports pagination" do
@@ -107,7 +107,7 @@ describe Dnsimple::Client, ".zones" do
107
107
  subject.zone(account_id, zone = "example.com")
108
108
 
109
109
  expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/zones/#{zone}")
110
- .with(headers: { 'Accept' => 'application/json' })
110
+ .with(headers: { "Accept" => "application/json" })
111
111
  end
112
112
 
113
113
  it "returns the zone" do
@@ -151,7 +151,7 @@ describe Dnsimple::Client, ".zones" do
151
151
  subject.zone_file(account_id, zone = "example.com")
152
152
 
153
153
  expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/zones/#{zone}/file")
154
- .with(headers: { 'Accept' => 'application/json' })
154
+ .with(headers: { "Accept" => "application/json" })
155
155
  end
156
156
 
157
157
  it "returns the zone id" do
@@ -187,7 +187,7 @@ describe Dnsimple::Client, ".zones" do
187
187
  subject.activate_dns(account_id, zone = "example.com")
188
188
 
189
189
  expect(WebMock).to have_requested(:put, "https://api.dnsimple.test/v2/#{account_id}/zones/#{zone}/activation")
190
- .with(headers: { 'Accept' => 'application/json' })
190
+ .with(headers: { "Accept" => "application/json" })
191
191
  end
192
192
 
193
193
  it "returns the zone" do
@@ -229,7 +229,7 @@ describe Dnsimple::Client, ".zones" do
229
229
  subject.deactivate_dns(account_id, zone = "example.com")
230
230
 
231
231
  expect(WebMock).to have_requested(:delete, "https://api.dnsimple.test/v2/#{account_id}/zones/#{zone}/activation")
232
- .with(headers: { 'Accept' => 'application/json' })
232
+ .with(headers: { "Accept" => "application/json" })
233
233
  end
234
234
 
235
235
  it "returns the zone" do
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spec_helper'
3
+ require "spec_helper"
4
4
 
5
5
  describe Dnsimple::Client do
6
6
 
@@ -135,11 +135,11 @@ describe Dnsimple::Client do
135
135
  it "performs a request" do
136
136
  stub_request(:get, %r{/foo})
137
137
 
138
- subject.request(:get, 'foo', {})
138
+ subject.request(:get, "foo", {})
139
139
 
140
140
  expect(WebMock).to have_requested(:get, "https://api.dnsimple.com/foo")
141
141
  .with(basic_auth: %w[user pass],
142
- headers: { 'Accept' => 'application/json', 'User-Agent' => Dnsimple::Default::USER_AGENT })
142
+ headers: { "Accept" => "application/json", "User-Agent" => Dnsimple::Default::USER_AGENT })
143
143
  end
144
144
 
145
145
  it "delegates to HTTParty" do
@@ -150,11 +150,11 @@ describe Dnsimple::Client do
150
150
  "#{subject.base_url}foo", {
151
151
  format: :json,
152
152
  basic_auth: { username: "user", password: "pass" },
153
- headers: { 'Accept' => 'application/json', 'User-Agent' => Dnsimple::Default::USER_AGENT },
153
+ headers: { "Accept" => "application/json", "User-Agent" => Dnsimple::Default::USER_AGENT },
154
154
  }
155
155
  )
156
156
 
157
- subject.request(:get, 'foo')
157
+ subject.request(:get, "foo")
158
158
  end
159
159
 
160
160
  it "properly extracts processes options and encodes data" do
@@ -165,12 +165,12 @@ describe Dnsimple::Client do
165
165
  body: JSON.dump(something: "else"),
166
166
  query: { foo: "bar" },
167
167
  basic_auth: { username: "user", password: "pass" },
168
- headers: { 'Accept' => 'application/json', 'Content-Type' => 'application/json', 'User-Agent' => Dnsimple::Default::USER_AGENT, "Custom" => "Header" },
168
+ headers: { "Accept" => "application/json", "Content-Type" => "application/json", "User-Agent" => Dnsimple::Default::USER_AGENT, "Custom" => "Header" },
169
169
  }
170
170
  )
171
171
 
172
172
  expect {
173
- subject.request(:put, 'foo', { something: "else" }, { query: { foo: "bar" }, headers: { "Custom" => "Header" } })
173
+ subject.request(:put, "foo", { something: "else" }, { query: { foo: "bar" }, headers: { "Custom" => "Header" } })
174
174
  }.not_to raise_error
175
175
  end
176
176
 
@@ -181,12 +181,12 @@ describe Dnsimple::Client do
181
181
  format: :json,
182
182
  body: { something: "else" },
183
183
  basic_auth: { username: "user", password: "pass" },
184
- headers: { 'Accept' => 'application/json', 'Content-Type' => 'application/x-www-form-urlencoded', 'User-Agent' => Dnsimple::Default::USER_AGENT },
184
+ headers: { "Accept" => "application/json", "Content-Type" => "application/x-www-form-urlencoded", "User-Agent" => Dnsimple::Default::USER_AGENT },
185
185
  }
186
186
  )
187
187
 
188
188
  expect {
189
- subject.request(:post, 'foo', { something: "else" }, { headers: { "Content-Type" => "application/x-www-form-urlencoded" } })
189
+ subject.request(:post, "foo", { something: "else" }, { headers: { "Content-Type" => "application/x-www-form-urlencoded" } })
190
190
  }.not_to raise_error
191
191
  end
192
192
 
@@ -197,7 +197,7 @@ describe Dnsimple::Client do
197
197
  format: :json,
198
198
  http_proxyaddr: "example-proxy.com",
199
199
  http_proxyport: "4321",
200
- headers: { 'Accept' => 'application/json', 'User-Agent' => Dnsimple::Default::USER_AGENT },
200
+ headers: { "Accept" => "application/json", "User-Agent" => Dnsimple::Default::USER_AGENT },
201
201
  }
202
202
  )
203
203
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spec_helper'
3
+ require "spec_helper"
4
4
 
5
5
  describe Dnsimple::Extra do
6
6
 
@@ -1,19 +1,19 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spec_helper'
3
+ require "spec_helper"
4
4
 
5
5
  RSpec.describe Dnsimple::Options::Base do
6
- describe '#initialize' do
7
- it 'accepts a hash' do
6
+ describe "#initialize" do
7
+ it "accepts a hash" do
8
8
  hash = { a: 1 }
9
9
  expect(described_class.new(hash).to_h).to eq(hash)
10
10
  end
11
11
 
12
- it 'accepts nil' do
12
+ it "accepts nil" do
13
13
  expect(described_class.new(nil).to_h).to eq({})
14
14
  end
15
15
 
16
- it 'duplicates given hash' do
16
+ it "duplicates given hash" do
17
17
  hash = { a: [1] }
18
18
  base = described_class.new(hash)
19
19
  base.to_h[:a] << 2
@@ -1,29 +1,29 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spec_helper'
3
+ require "spec_helper"
4
4
 
5
5
  RSpec.describe Dnsimple::Options::ListOptions do
6
- describe '#to_h' do
7
- it 'returns empty hash if given options equal to nil' do
6
+ describe "#to_h" do
7
+ it "returns empty hash if given options equal to nil" do
8
8
  options = described_class.new(nil)
9
9
  expect(options.to_h).to eq({})
10
10
  end
11
11
 
12
- it 'returns empty hash if given options are empty' do
12
+ it "returns empty hash if given options are empty" do
13
13
  options = described_class.new({})
14
14
  expect(options.to_h).to eq({})
15
15
  end
16
16
 
17
- describe 'query' do
17
+ describe "query" do
18
18
  it 'adds "query" key if given options are filled' do
19
19
  options = described_class.new(a: 1)
20
20
  expect(options.to_h).to have_key(:query)
21
21
  end
22
22
  end
23
23
 
24
- describe 'pagination' do
24
+ describe "pagination" do
25
25
  it 'adds "page" to "query"' do
26
- raw = { page: '23' }
26
+ raw = { page: "23" }
27
27
  expected = { query: raw }
28
28
  options = described_class.new(raw)
29
29
 
@@ -31,7 +31,7 @@ RSpec.describe Dnsimple::Options::ListOptions do
31
31
  end
32
32
 
33
33
  it 'adds "per_page" to "query"' do
34
- raw = { per_page: '500' }
34
+ raw = { per_page: "500" }
35
35
  expected = { query: raw }
36
36
  options = described_class.new(raw)
37
37
 
@@ -39,7 +39,7 @@ RSpec.describe Dnsimple::Options::ListOptions do
39
39
  end
40
40
 
41
41
  it 'combines "page" and "per_page"' do
42
- raw = { page: '1', per_page: '100' }
42
+ raw = { page: "1", per_page: "100" }
43
43
  expected = { query: raw }
44
44
  options = described_class.new(raw)
45
45
 
@@ -47,25 +47,25 @@ RSpec.describe Dnsimple::Options::ListOptions do
47
47
  end
48
48
  end
49
49
 
50
- describe 'sorting' do
50
+ describe "sorting" do
51
51
  it 'adds sorting policy to "query"' do
52
- raw = { sort: 'name:desc' }
52
+ raw = { sort: "name:desc" }
53
53
  expected = { query: raw }
54
54
  options = described_class.new(raw)
55
55
 
56
56
  expect(options.to_h).to eq(expected)
57
57
  end
58
58
 
59
- it 'combines with filtering' do
60
- raw = { sort: 'name:desc', filter: { name: 'foo' } }
59
+ it "combines with filtering" do
60
+ raw = { sort: "name:desc", filter: { name: "foo" } }
61
61
  expected = { query: { sort: raw.fetch(:sort) }.merge(raw.fetch(:filter)) }
62
62
  options = described_class.new(raw)
63
63
 
64
64
  expect(options.to_h).to eq(expected)
65
65
  end
66
66
 
67
- it 'combines with pagination' do
68
- raw = { sort: 'name:desc', page: '2', per_page: '100' }
67
+ it "combines with pagination" do
68
+ raw = { sort: "name:desc", page: "2", per_page: "100" }
69
69
  expected = { query: raw }
70
70
  options = described_class.new(raw)
71
71
 
@@ -73,25 +73,25 @@ RSpec.describe Dnsimple::Options::ListOptions do
73
73
  end
74
74
  end
75
75
 
76
- describe 'filtering' do
76
+ describe "filtering" do
77
77
  it 'adds filtering policy to "query"' do
78
- raw = { filter: { name_like: 'example' } }
78
+ raw = { filter: { name_like: "example" } }
79
79
  expected = { query: raw.fetch(:filter) }
80
80
  options = described_class.new(raw)
81
81
 
82
82
  expect(options.to_h).to eq(expected)
83
83
  end
84
84
 
85
- it 'combines with sorting' do
86
- raw = { filter: { name_like: 'bar' }, sort: 'tld:desc' }
85
+ it "combines with sorting" do
86
+ raw = { filter: { name_like: "bar" }, sort: "tld:desc" }
87
87
  expected = { query: raw.fetch(:filter).merge(sort: raw.fetch(:sort)) }
88
88
  options = described_class.new(raw)
89
89
 
90
90
  expect(options.to_h).to eq(expected)
91
91
  end
92
92
 
93
- it 'combines with pagination' do
94
- raw = { filter: { name_like: 'example' }, page: '1', per_page: '20' }
93
+ it "combines with pagination" do
94
+ raw = { filter: { name_like: "example" }, page: "1", per_page: "20" }
95
95
  expected = { query: { page: raw.fetch(:page), per_page: raw.fetch(:per_page) }.merge(raw.fetch(:filter)) }
96
96
  options = described_class.new(raw)
97
97
 
@@ -17,4 +17,5 @@ X-Permitted-Cross-Domain-Policies: none
17
17
  X-XSS-Protection: 1; mode=block
18
18
  Strict-Transport-Security: max-age=31536000
19
19
 
20
- {"data":[{"id":123,"email":"john@example.com","plan_identifier":"dnsimple-personal","created_at":"2011-09-11T17:15:58Z","updated_at":"2016-06-03T15:02:26Z"},{"id":456,"email":"ops@company.com","plan_identifier":"dnsimple-professional","created_at":"2012-03-16T16:02:54Z","updated_at":"2016-06-14T11:23:16Z"}]}
20
+ {"data":[{"id":123,"email":"john@example.com","plan_identifier":"dnsimple-personal","created_at":"2011-09-11T17:15:58Z","updated_at":"2016-06-03T15:02:26Z"},{"id":456,"email":"ops@company.com","plan_identifier":"teams-v1-monthly","created_at":"2012-03-16T16:02:54Z","updated_at":"2016-06-14T11:23:16Z"}]}
21
+
@@ -2,13 +2,13 @@ HTTP/1.1 404
2
2
  server: nginx
3
3
  date: Tue, 22 Aug 2023 13:59:02 GMT
4
4
  content-type: application/json; charset=utf-8
5
- x-ratelimit-limit: 2400
6
- x-ratelimit-remaining: 2398
7
- x-ratelimit-reset: 1692716201
5
+ X-RateLimit-Limit: 2400
6
+ X-RateLimit-Remaining: 2398
7
+ X-RateLimit-Reset: 1692716201
8
8
  x-work-with-us: Love automation? So do we! https://dnsimple.com/jobs
9
9
  cache-control: no-cache
10
10
  x-request-id: b1dd3f42-ebb9-42fd-a121-d595de96f667
11
11
  x-runtime: 0.019122
12
12
  strict-transport-security: max-age=63072000
13
13
 
14
- {"message":"Contact `21` not found"}
14
+ {"message":"Contact `21` not found"}
@@ -2,9 +2,9 @@ HTTP/1.1 404
2
2
  server: nginx
3
3
  date: Tue, 22 Aug 2023 11:09:40 GMT
4
4
  content-type: application/json; charset=utf-8
5
- x-ratelimit-limit: 2400
6
- x-ratelimit-remaining: 2395
7
- x-ratelimit-reset: 1692705338
5
+ X-RateLimit-Limit: 2400
6
+ X-RateLimit-Remaining: 2395
7
+ X-RateLimit-Reset: 1692705338
8
8
  x-work-with-us: Love automation? So do we! https://dnsimple.com/jobs
9
9
  etag: W/"cef1e7d85d0b9bfd25e81b812891d34f"
10
10
  cache-control: max-age=0, private, must-revalidate
@@ -12,4 +12,4 @@ x-request-id: 5b0d8bfb-7b6a-40b5-a079-b640fd817e34
12
12
  x-runtime: 3.066249
13
13
  strict-transport-security: max-age=63072000
14
14
 
15
- {"message":"Domain `example.com` not found"}
15
+ {"message":"Domain `dnsimple-rraform.bio` not found"}