dnsimple 9.0.1 → 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 (98) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +5 -7
  3. data/.github/workflows/ci.yml +4 -4
  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 +9 -0
  10. data/Gemfile +7 -7
  11. data/LICENSE.txt +1 -1
  12. data/README.md +3 -3
  13. data/lib/dnsimple/client/clients.rb +29 -31
  14. data/lib/dnsimple/client/domains_email_forwards.rb +1 -1
  15. data/lib/dnsimple/client.rb +5 -5
  16. data/lib/dnsimple/default.rb +7 -7
  17. data/lib/dnsimple/response.rb +3 -3
  18. data/lib/dnsimple/struct/charge.rb +1 -1
  19. data/lib/dnsimple/struct/email_forward.rb +0 -8
  20. data/lib/dnsimple/struct.rb +40 -40
  21. data/lib/dnsimple/version.rb +1 -1
  22. data/lib/dnsimple.rb +5 -5
  23. data/spec/dnsimple/client/accounts_spec.rb +2 -2
  24. data/spec/dnsimple/client/billing_spec.rb +3 -3
  25. data/spec/dnsimple/client/certificates_spec.rb +11 -11
  26. data/spec/dnsimple/client/client_service_spec.rb +1 -1
  27. data/spec/dnsimple/client/contacts_spec.rb +6 -6
  28. data/spec/dnsimple/client/dns_analytics_spec.rb +9 -9
  29. data/spec/dnsimple/client/domains_delegation_signer_records_spec.rb +5 -5
  30. data/spec/dnsimple/client/domains_dnssec_spec.rb +4 -4
  31. data/spec/dnsimple/client/domains_email_forwards_spec.rb +8 -15
  32. data/spec/dnsimple/client/domains_pushes_spec.rb +5 -5
  33. data/spec/dnsimple/client/domains_spec.rb +6 -6
  34. data/spec/dnsimple/client/identity_spec.rb +2 -2
  35. data/spec/dnsimple/client/oauth_spec.rb +3 -3
  36. data/spec/dnsimple/client/registrar_auto_renewal_spec.rb +3 -3
  37. data/spec/dnsimple/client/registrar_delegation_spec.rb +1 -1
  38. data/spec/dnsimple/client/registrar_spec.rb +1 -1
  39. data/spec/dnsimple/client/registrar_transfer_lock_spec.rb +4 -4
  40. data/spec/dnsimple/client/registrar_whois_privacy_spec.rb +1 -1
  41. data/spec/dnsimple/client/services_domains_spec.rb +4 -4
  42. data/spec/dnsimple/client/services_spec.rb +1 -1
  43. data/spec/dnsimple/client/templates_domains_spec.rb +2 -2
  44. data/spec/dnsimple/client/templates_records_spec.rb +4 -4
  45. data/spec/dnsimple/client/templates_spec.rb +2 -2
  46. data/spec/dnsimple/client/tlds_spec.rb +5 -5
  47. data/spec/dnsimple/client/vanity_name_servers_spec.rb +1 -1
  48. data/spec/dnsimple/client/webhooks_spec.rb +5 -5
  49. data/spec/dnsimple/client/zones_distributions_spec.rb +3 -3
  50. data/spec/dnsimple/client/zones_records_spec.rb +7 -7
  51. data/spec/dnsimple/client/zones_spec.rb +6 -6
  52. data/spec/dnsimple/client_spec.rb +10 -10
  53. data/spec/dnsimple/extra_spec.rb +1 -1
  54. data/spec/dnsimple/options/base_spec.rb +5 -5
  55. data/spec/dnsimple/options/list_options_spec.rb +21 -21
  56. data/spec/fixtures.http/accounts/success-user.http +2 -1
  57. data/spec/fixtures.http/checkRegistrantChange/error-contactnotfound.http +4 -4
  58. data/spec/fixtures.http/checkRegistrantChange/error-domainnotfound.http +4 -4
  59. data/spec/fixtures.http/checkRegistrantChange/success.http +5 -5
  60. data/spec/fixtures.http/createContact/error-validation-errors.http +18 -0
  61. data/spec/fixtures.http/createEmailForward/created.http +1 -2
  62. data/spec/fixtures.http/createRegistrantChange/success.http +5 -5
  63. data/spec/fixtures.http/createWebhook/created.http +16 -16
  64. data/spec/fixtures.http/deleteRegistrantChange/success.http +4 -4
  65. data/spec/fixtures.http/deleteRegistrantChange/success_async.http +14 -0
  66. data/spec/fixtures.http/dnsAnalytics/success.http +1 -1
  67. data/spec/fixtures.http/getDomainPrices/failure.http +18 -18
  68. data/spec/fixtures.http/getDomainPrices/success.http +21 -21
  69. data/spec/fixtures.http/getDomainRestore/success.http +13 -14
  70. data/spec/fixtures.http/getEmailForward/success.http +1 -2
  71. data/spec/fixtures.http/getRegistrantChange/success.http +5 -5
  72. data/spec/fixtures.http/getTld/success.http +1 -1
  73. data/spec/fixtures.http/getWebhook/success.http +16 -16
  74. data/spec/fixtures.http/listAccounts/success-user.http +1 -1
  75. data/spec/fixtures.http/listCharges/fail-400-bad-filter.http +0 -2
  76. data/spec/fixtures.http/listCharges/fail-403.http +0 -2
  77. data/spec/fixtures.http/listCharges/success.http +0 -2
  78. data/spec/fixtures.http/listEmailForwards/success.http +1 -1
  79. data/spec/fixtures.http/listRegistrantChanges/success.http +5 -5
  80. data/spec/fixtures.http/listTlds/success.http +1 -1
  81. data/spec/fixtures.http/listWebhooks/success.http +16 -16
  82. data/spec/fixtures.http/registerDomain/error-extended-attributes.http +18 -0
  83. data/spec/fixtures.http/restoreDomain/success.http +12 -13
  84. data/spec/fixtures.http/updateZoneNsRecords/success.http +16 -0
  85. data/spec/fixtures.http/whoami/success-account.http +1 -1
  86. data/spec/fixtures.http/whoami/success.http +1 -1
  87. data/spec/spec_helper.rb +4 -4
  88. data/spec/support/webmock.rb +1 -1
  89. metadata +7 -11
  90. data/.github/CODEOWNERS +0 -1
  91. data/.github/workflows/auto-merge.yml +0 -32
  92. data/lib/dnsimple/client/domains_collaborators.rb +0 -87
  93. data/spec/dnsimple/client/domains_collaborators_spec.rb +0 -164
  94. data/spec/fixtures.http/addCollaborator/invite-success.http +0 -20
  95. data/spec/fixtures.http/addCollaborator/success.http +0 -20
  96. data/spec/fixtures.http/listCollaborators/success.http +0 -20
  97. data/spec/fixtures.http/notfound-collaborator.http +0 -15
  98. data/spec/fixtures.http/removeCollaborator/success.http +0 -17
@@ -15,43 +15,43 @@ module Dnsimple
15
15
  end
16
16
  end
17
17
 
18
- require_relative 'struct/account'
19
- require_relative 'struct/collaborator'
20
- require_relative 'struct/contact'
21
- require_relative 'struct/certificate'
22
- require_relative 'struct/certificate_bundle'
23
- require_relative 'struct/certificate_purchase'
24
- require_relative 'struct/certificate_renewal'
25
- require_relative 'struct/charge'
26
- require_relative 'struct/delegation_signer_record'
27
- require_relative 'struct/dnssec'
28
- require_relative 'struct/domain'
29
- require_relative 'struct/domain_check'
30
- require_relative 'struct/domain_premium_price'
31
- require_relative 'struct/domain_price'
32
- require_relative 'struct/domain_push'
33
- require_relative 'struct/domain_registration'
34
- require_relative 'struct/domain_restore'
35
- require_relative 'struct/domain_transfer'
36
- require_relative 'struct/domain_renewal'
37
- require_relative 'struct/dns_analytics'
38
- require_relative 'struct/email_forward'
39
- require_relative 'struct/extended_attribute'
40
- require_relative 'struct/oauth_token'
41
- require_relative 'struct/registrant_change_check'
42
- require_relative 'struct/registrant_change'
43
- require_relative 'struct/transfer_lock'
44
- require_relative 'struct/zone_record'
45
- require_relative 'struct/service'
46
- require_relative 'struct/template'
47
- require_relative 'struct/template_record'
48
- require_relative 'struct/tld'
49
- require_relative 'struct/user'
50
- require_relative 'struct/vanity_name_server'
51
- require_relative 'struct/whois_privacy'
52
- require_relative 'struct/whois_privacy_renewal'
53
- require_relative 'struct/zone'
54
- require_relative 'struct/zone_file'
55
- require_relative 'struct/zone_distribution'
56
- require_relative 'struct/webhook'
57
- require_relative 'struct/whoami'
18
+ require_relative "struct/account"
19
+ require_relative "struct/collaborator"
20
+ require_relative "struct/contact"
21
+ require_relative "struct/certificate"
22
+ require_relative "struct/certificate_bundle"
23
+ require_relative "struct/certificate_purchase"
24
+ require_relative "struct/certificate_renewal"
25
+ require_relative "struct/charge"
26
+ require_relative "struct/delegation_signer_record"
27
+ require_relative "struct/dnssec"
28
+ require_relative "struct/domain"
29
+ require_relative "struct/domain_check"
30
+ require_relative "struct/domain_premium_price"
31
+ require_relative "struct/domain_price"
32
+ require_relative "struct/domain_push"
33
+ require_relative "struct/domain_registration"
34
+ require_relative "struct/domain_restore"
35
+ require_relative "struct/domain_transfer"
36
+ require_relative "struct/domain_renewal"
37
+ require_relative "struct/dns_analytics"
38
+ require_relative "struct/email_forward"
39
+ require_relative "struct/extended_attribute"
40
+ require_relative "struct/oauth_token"
41
+ require_relative "struct/registrant_change_check"
42
+ require_relative "struct/registrant_change"
43
+ require_relative "struct/transfer_lock"
44
+ require_relative "struct/zone_record"
45
+ require_relative "struct/service"
46
+ require_relative "struct/template"
47
+ require_relative "struct/template_record"
48
+ require_relative "struct/tld"
49
+ require_relative "struct/user"
50
+ require_relative "struct/vanity_name_server"
51
+ require_relative "struct/whois_privacy"
52
+ require_relative "struct/whois_privacy_renewal"
53
+ require_relative "struct/zone"
54
+ require_relative "struct/zone_file"
55
+ require_relative "struct/zone_distribution"
56
+ require_relative "struct/webhook"
57
+ require_relative "struct/whoami"
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Dnsimple
4
4
 
5
- VERSION = "9.0.1"
5
+ VERSION = "11.0.0"
6
6
 
7
7
  end
data/lib/dnsimple.rb CHANGED
@@ -16,8 +16,8 @@ module Dnsimple
16
16
 
17
17
  end
18
18
 
19
- require 'dnsimple/version'
20
- require 'dnsimple/default'
21
- require 'dnsimple/client'
22
- require 'dnsimple/error'
23
- require 'dnsimple/options'
19
+ require "dnsimple/version"
20
+ require "dnsimple/default"
21
+ require "dnsimple/client"
22
+ require "dnsimple/error"
23
+ require "dnsimple/options"
@@ -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, ".accounts" do
6
6
 
@@ -17,7 +17,7 @@ describe Dnsimple::Client, ".accounts" do
17
17
  subject.accounts
18
18
 
19
19
  expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/accounts")
20
- .with(headers: { 'Accept' => 'application/json' })
20
+ .with(headers: { "Accept" => "application/json" })
21
21
  end
22
22
 
23
23
  it "returns the accounts" do
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spec_helper'
3
+ require "spec_helper"
4
4
 
5
- require 'bigdecimal/util'
5
+ require "bigdecimal/util"
6
6
 
7
7
  describe Dnsimple::Client, ".billing" do
8
8
 
@@ -20,7 +20,7 @@ describe Dnsimple::Client, ".billing" do
20
20
  subject.charges(account_id)
21
21
 
22
22
  expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/billing/charges")
23
- .with(headers: { 'Accept' => 'application/json' })
23
+ .with(headers: { "Accept" => "application/json" })
24
24
  end
25
25
 
26
26
  it "exposes the pagination information" 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, ".certificates" do
6
6
 
@@ -19,7 +19,7 @@ describe Dnsimple::Client, ".certificates" do
19
19
  subject.certificates(account_id, domain_id)
20
20
 
21
21
  expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/certificates")
22
- .with(headers: { 'Accept' => 'application/json' })
22
+ .with(headers: { "Accept" => "application/json" })
23
23
  end
24
24
 
25
25
  it "supports pagination" do
@@ -93,7 +93,7 @@ describe Dnsimple::Client, ".certificates" do
93
93
  subject.certificate(account_id, domain_id, certificate_id)
94
94
 
95
95
  expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/certificates/#{certificate_id}")
96
- .with(headers: { 'Accept' => 'application/json' })
96
+ .with(headers: { "Accept" => "application/json" })
97
97
  end
98
98
 
99
99
  it "supports extra request options" do
@@ -149,7 +149,7 @@ describe Dnsimple::Client, ".certificates" do
149
149
  subject.download_certificate(account_id, domain_id, certificate_id)
150
150
 
151
151
  expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/certificates/#{certificate_id}/download")
152
- .with(headers: { 'Accept' => 'application/json' })
152
+ .with(headers: { "Accept" => "application/json" })
153
153
  end
154
154
 
155
155
  it "supports extra request options" do
@@ -196,7 +196,7 @@ describe Dnsimple::Client, ".certificates" do
196
196
  subject.certificate_private_key(account_id, domain_id, certificate_id)
197
197
 
198
198
  expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/certificates/#{certificate_id}/private_key")
199
- .with(headers: { 'Accept' => 'application/json' })
199
+ .with(headers: { "Accept" => "application/json" })
200
200
  end
201
201
 
202
202
  it "supports extra request options" do
@@ -244,7 +244,7 @@ describe Dnsimple::Client, ".certificates" do
244
244
 
245
245
  expect(WebMock).to have_requested(:post, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/certificates/letsencrypt")
246
246
  .with(body: attributes)
247
- .with(headers: { 'Accept' => 'application/json' })
247
+ .with(headers: { "Accept" => "application/json" })
248
248
  end
249
249
 
250
250
  it "passes extra attributes" do
@@ -253,7 +253,7 @@ describe Dnsimple::Client, ".certificates" do
253
253
 
254
254
  expect(WebMock).to have_requested(:post, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/certificates/letsencrypt")
255
255
  .with(body: attributes)
256
- .with(headers: { 'Accept' => 'application/json' })
256
+ .with(headers: { "Accept" => "application/json" })
257
257
  end
258
258
 
259
259
  it "returns the certificate purchase" do
@@ -295,7 +295,7 @@ describe Dnsimple::Client, ".certificates" do
295
295
  subject.issue_letsencrypt_certificate(account_id, domain_id, certificate_id)
296
296
 
297
297
  expect(WebMock).to have_requested(:post, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/certificates/letsencrypt/#{certificate_id}/issue")
298
- .with(headers: { 'Accept' => 'application/json' })
298
+ .with(headers: { "Accept" => "application/json" })
299
299
  end
300
300
 
301
301
  it "returns the certificate" do
@@ -353,7 +353,7 @@ describe Dnsimple::Client, ".certificates" do
353
353
  subject.purchase_letsencrypt_certificate_renewal(account_id, domain_id, certificate_id)
354
354
 
355
355
  expect(WebMock).to have_requested(:post, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/certificates/letsencrypt/#{certificate_id}/renewals")
356
- .with(headers: { 'Accept' => 'application/json' })
356
+ .with(headers: { "Accept" => "application/json" })
357
357
  end
358
358
 
359
359
  it "passes extra attributes" do
@@ -362,7 +362,7 @@ describe Dnsimple::Client, ".certificates" do
362
362
 
363
363
  expect(WebMock).to have_requested(:post, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/certificates/letsencrypt/#{certificate_id}/renewals")
364
364
  .with(body: attributes)
365
- .with(headers: { 'Accept' => 'application/json' })
365
+ .with(headers: { "Accept" => "application/json" })
366
366
  end
367
367
 
368
368
  it "returns the certificate renew" do
@@ -405,7 +405,7 @@ describe Dnsimple::Client, ".certificates" do
405
405
  subject.issue_letsencrypt_certificate_renewal(account_id, domain_id, certificate_id, certificate_renewal_id)
406
406
 
407
407
  expect(WebMock).to have_requested(:post, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/certificates/letsencrypt/#{certificate_id}/renewals/#{certificate_renewal_id}/issue")
408
- .with(headers: { 'Accept' => 'application/json' })
408
+ .with(headers: { "Accept" => "application/json" })
409
409
  end
410
410
 
411
411
  it "returns the certificate" 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::ClientService 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, ".contacts" do
6
6
 
@@ -19,7 +19,7 @@ describe Dnsimple::Client, ".contacts" do
19
19
  subject.contacts(account_id)
20
20
 
21
21
  expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/contacts")
22
- .with(headers: { 'Accept' => 'application/json' })
22
+ .with(headers: { "Accept" => "application/json" })
23
23
  end
24
24
 
25
25
  it "supports pagination" do
@@ -99,7 +99,7 @@ describe Dnsimple::Client, ".contacts" do
99
99
 
100
100
  expect(WebMock).to have_requested(:post, "https://api.dnsimple.test/v2/#{account_id}/contacts")
101
101
  .with(body: attributes)
102
- .with(headers: { 'Accept' => 'application/json' })
102
+ .with(headers: { "Accept" => "application/json" })
103
103
  end
104
104
 
105
105
  it "returns the contact" do
@@ -124,7 +124,7 @@ describe Dnsimple::Client, ".contacts" do
124
124
  subject.contact(account_id, contact = 1)
125
125
 
126
126
  expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/contacts/#{contact}")
127
- .with(headers: { 'Accept' => 'application/json' })
127
+ .with(headers: { "Accept" => "application/json" })
128
128
  end
129
129
 
130
130
  it "returns the contact" do
@@ -166,7 +166,7 @@ describe Dnsimple::Client, ".contacts" do
166
166
 
167
167
  expect(WebMock).to have_requested(:patch, "https://api.dnsimple.test/v2/#{account_id}/contacts/#{contact_id}")
168
168
  .with(body: attributes)
169
- .with(headers: { 'Accept' => 'application/json' })
169
+ .with(headers: { "Accept" => "application/json" })
170
170
  end
171
171
 
172
172
  it "returns the contact" do
@@ -202,7 +202,7 @@ describe Dnsimple::Client, ".contacts" do
202
202
  subject.delete_contact(account_id, domain = "example.com")
203
203
 
204
204
  expect(WebMock).to have_requested(:delete, "https://api.dnsimple.test/v2/#{account_id}/contacts/#{domain}")
205
- .with(headers: { 'Accept' => 'application/json' })
205
+ .with(headers: { "Accept" => "application/json" })
206
206
  end
207
207
 
208
208
  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, ".dns_analytics" do
6
6
 
@@ -16,7 +16,7 @@ describe Dnsimple::Client, ".dns_analytics" do
16
16
  subject.query(1)
17
17
 
18
18
  expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/1/dns_analytics")
19
- .with(headers: { 'Accept' => 'application/json' })
19
+ .with(headers: { "Accept" => "application/json" })
20
20
  end
21
21
 
22
22
  it "supports pagination" do
@@ -32,13 +32,13 @@ describe Dnsimple::Client, ".dns_analytics" do
32
32
  end
33
33
 
34
34
  it "supports filtering" do
35
- subject.query(1, filter: { start_date: '2024-08-01', end_date: '2024-09-01' })
35
+ subject.query(1, filter: { start_date: "2024-08-01", end_date: "2024-09-01" })
36
36
 
37
37
  expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/1/dns_analytics?start_date=2024-08-01&end_date=2024-09-01")
38
38
  end
39
39
 
40
40
  it "supports groupings" do
41
- subject.query(1, groupings: 'date,zone_name')
41
+ subject.query(1, groupings: "date,zone_name")
42
42
 
43
43
  expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/1/dns_analytics?groupings=date,zone_name")
44
44
  end
@@ -52,8 +52,8 @@ describe Dnsimple::Client, ".dns_analytics" do
52
52
  expect(response.data.size).to eq(12)
53
53
 
54
54
  expect(response.data.all?(Dnsimple::Struct::DnsAnalytics)).to be(true)
55
- expect(response.data[0].date).to eq('2023-12-08')
56
- expect(response.data[0].zone_name).to eq('bar.com')
55
+ expect(response.data[0].date).to eq("2023-12-08")
56
+ expect(response.data[0].zone_name).to eq("bar.com")
57
57
  expect(response.data[0].volume).to eq(1200)
58
58
  end
59
59
 
@@ -72,9 +72,9 @@ describe Dnsimple::Client, ".dns_analytics" do
72
72
 
73
73
  expect(response.respond_to?(:query)).to be(true)
74
74
  query = response.query
75
- expect(query["account_id"]).to eq("1")
76
- expect(query["start_date"]).to eq('2023-12-08')
77
- expect(query["end_date"]).to eq('2024-01-08')
75
+ expect(query["account_id"]).to eq(1)
76
+ expect(query["start_date"]).to eq("2023-12-08")
77
+ expect(query["end_date"]).to eq("2024-01-08")
78
78
  expect(query["sort"]).to eq("zone_name:asc,date:asc")
79
79
  expect(query["groupings"]).to eq("zone_name,date")
80
80
  expect(query["page"]).to eq(0)
@@ -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, ".domains" do
6
6
 
@@ -20,7 +20,7 @@ describe Dnsimple::Client, ".domains" do
20
20
  subject.delegation_signer_records(account_id, domain_id)
21
21
 
22
22
  expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/ds_records")
23
- .with(headers: { 'Accept' => 'application/json' })
23
+ .with(headers: { "Accept" => "application/json" })
24
24
  end
25
25
 
26
26
  it "supports pagination" do
@@ -113,7 +113,7 @@ describe Dnsimple::Client, ".domains" do
113
113
 
114
114
  expect(WebMock).to have_requested(:post, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/ds_records")
115
115
  .with(body: attributes)
116
- .with(headers: { 'Accept' => 'application/json' })
116
+ .with(headers: { "Accept" => "application/json" })
117
117
  end
118
118
 
119
119
  it "returns the delegation signer record" do
@@ -140,7 +140,7 @@ describe Dnsimple::Client, ".domains" do
140
140
  subject.delegation_signer_record(account_id, domain_id, ds_record_id)
141
141
 
142
142
  expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/ds_records/#{ds_record_id}")
143
- .with(headers: { 'Accept' => 'application/json' })
143
+ .with(headers: { "Accept" => "application/json" })
144
144
  end
145
145
 
146
146
  it "returns the delegation signer record" do
@@ -186,7 +186,7 @@ describe Dnsimple::Client, ".domains" do
186
186
  subject.delete_delegation_signer_record(account_id, domain_id, ds_record_id)
187
187
 
188
188
  expect(WebMock).to have_requested(:delete, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/ds_records/#{ds_record_id}")
189
- .with(headers: { 'Accept' => 'application/json' })
189
+ .with(headers: { "Accept" => "application/json" })
190
190
  end
191
191
 
192
192
  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, ".domains" do
6
6
 
@@ -20,7 +20,7 @@ describe Dnsimple::Client, ".domains" do
20
20
  subject.enable_dnssec(account_id, domain_id)
21
21
 
22
22
  expect(WebMock).to have_requested(:post, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/dnssec")
23
- .with(headers: { 'Accept' => 'application/json' })
23
+ .with(headers: { "Accept" => "application/json" })
24
24
  end
25
25
 
26
26
  it "returns the dnssec status" do
@@ -59,7 +59,7 @@ describe Dnsimple::Client, ".domains" do
59
59
  subject.disable_dnssec(account_id, domain_id)
60
60
 
61
61
  expect(WebMock).to have_requested(:delete, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/dnssec")
62
- .with(headers: { 'Accept' => 'application/json' })
62
+ .with(headers: { "Accept" => "application/json" })
63
63
  end
64
64
 
65
65
  it "returns nothing" do
@@ -96,7 +96,7 @@ describe Dnsimple::Client, ".domains" do
96
96
  subject.get_dnssec(account_id, domain_id)
97
97
 
98
98
  expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/dnssec")
99
- .with(headers: { 'Accept' => 'application/json' })
99
+ .with(headers: { "Accept" => "application/json" })
100
100
  end
101
101
 
102
102
  it "returns the dnssec status" 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, ".domains" do
6
6
 
@@ -20,7 +20,7 @@ describe Dnsimple::Client, ".domains" do
20
20
  subject.email_forwards(account_id, domain_id)
21
21
 
22
22
  expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/email_forwards")
23
- .with(headers: { 'Accept' => 'application/json' })
23
+ .with(headers: { "Accept" => "application/json" })
24
24
  end
25
25
 
26
26
  it "supports pagination" do
@@ -46,18 +46,13 @@ describe Dnsimple::Client, ".domains" do
46
46
 
47
47
  expect(response).to be_a(Dnsimple::PaginatedResponse)
48
48
  expect(response.data).to be_a(Array)
49
- expect(response.data.size).to eq(2)
49
+ expect(response.data.size).to eq(1)
50
50
 
51
51
  expect(response.data[0].id).to eq(24809)
52
52
  expect(response.data[0].domain_id).to eq(235146)
53
- expect(response.data[0].alias_email).to eq("foo@a-domain.com")
53
+ expect(response.data[0].alias_email).to eq(".*@a-domain.com")
54
54
  expect(response.data[0].destination_email).to eq("jane.smith@example.com")
55
55
  expect(response.data[0].active).to be(true)
56
- expect(response.data[1].id).to eq(24810)
57
- expect(response.data[1].domain_id).to eq(235146)
58
- expect(response.data[1].alias_email).to eq("bar@a-domain.com")
59
- expect(response.data[1].destination_email).to eq("john.doe@example.com")
60
- expect(response.data[1].active).to be(false)
61
56
  end
62
57
 
63
58
  it "exposes the pagination information" do
@@ -105,7 +100,7 @@ describe Dnsimple::Client, ".domains" do
105
100
 
106
101
  describe "#create_email_forward" do
107
102
  let(:account_id) { 1010 }
108
- let(:attributes) { { from: "jim", to: "jim@another.com" } }
103
+ let(:attributes) { { alias_name: "jim", destination_email: "jim@another.com" } }
109
104
  let(:domain_id) { "example.com" }
110
105
 
111
106
  before do
@@ -119,7 +114,7 @@ describe Dnsimple::Client, ".domains" do
119
114
 
120
115
  expect(WebMock).to have_requested(:post, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/email_forwards")
121
116
  .with(body: attributes)
122
- .with(headers: { 'Accept' => 'application/json' })
117
+ .with(headers: { "Accept" => "application/json" })
123
118
  end
124
119
 
125
120
  it "returns the email forward" do
@@ -146,7 +141,7 @@ describe Dnsimple::Client, ".domains" do
146
141
  subject.email_forward(account_id, domain_id, email_forward_id)
147
142
 
148
143
  expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/email_forwards/#{email_forward_id}")
149
- .with(headers: { 'Accept' => 'application/json' })
144
+ .with(headers: { "Accept" => "application/json" })
150
145
  end
151
146
 
152
147
  it "returns the email forward" do
@@ -157,8 +152,6 @@ describe Dnsimple::Client, ".domains" do
157
152
  expect(result).to be_a(Dnsimple::Struct::EmailForward)
158
153
  expect(result.id).to eq(41872)
159
154
  expect(result.domain_id).to eq(235146)
160
- expect(result.from).to eq("example@dnsimple.xyz")
161
- expect(result.to).to eq("example@example.com")
162
155
  expect(result.alias_email).to eq("example@dnsimple.xyz")
163
156
  expect(result.destination_email).to eq("example@example.com")
164
157
  expect(result.created_at).to eq("2021-01-25T13:54:40Z")
@@ -191,7 +184,7 @@ describe Dnsimple::Client, ".domains" do
191
184
  subject.delete_email_forward(account_id, domain_id, email_forward_id)
192
185
 
193
186
  expect(WebMock).to have_requested(:delete, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/email_forwards/#{email_forward_id}")
194
- .with(headers: { 'Accept' => 'application/json' })
187
+ .with(headers: { "Accept" => "application/json" })
195
188
  end
196
189
 
197
190
  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, ".domains" do
6
6
 
@@ -22,7 +22,7 @@ describe Dnsimple::Client, ".domains" do
22
22
 
23
23
  expect(WebMock).to have_requested(:post, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/pushes")
24
24
  .with(body: attributes)
25
- .with(headers: { 'Accept' => 'application/json' })
25
+ .with(headers: { "Accept" => "application/json" })
26
26
  end
27
27
 
28
28
  it "returns the domain push" do
@@ -47,7 +47,7 @@ describe Dnsimple::Client, ".domains" do
47
47
  subject.pushes(account_id)
48
48
 
49
49
  expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/pushes")
50
- .with(headers: { 'Accept' => 'application/json' })
50
+ .with(headers: { "Accept" => "application/json" })
51
51
  end
52
52
 
53
53
  it "supports pagination" do
@@ -102,7 +102,7 @@ describe Dnsimple::Client, ".domains" do
102
102
 
103
103
  expect(WebMock).to have_requested(:post, "https://api.dnsimple.test/v2/#{account_id}/pushes/#{push_id}")
104
104
  .with(body: attributes)
105
- .with(headers: { 'Accept' => 'application/json' })
105
+ .with(headers: { "Accept" => "application/json" })
106
106
  end
107
107
 
108
108
  it "returns nothing" do
@@ -138,7 +138,7 @@ describe Dnsimple::Client, ".domains" do
138
138
  subject.reject_push(account_id, push_id)
139
139
 
140
140
  expect(WebMock).to have_requested(:delete, "https://api.dnsimple.test/v2/#{account_id}/pushes/#{push_id}")
141
- .with(headers: { 'Accept' => 'application/json' })
141
+ .with(headers: { "Accept" => "application/json" })
142
142
  end
143
143
 
144
144
  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, ".domains" do
6
6
 
@@ -19,7 +19,7 @@ describe Dnsimple::Client, ".domains" do
19
19
  subject.domains(account_id)
20
20
 
21
21
  expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/domains")
22
- .with(headers: { 'Accept' => 'application/json' })
22
+ .with(headers: { "Accept" => "application/json" })
23
23
  end
24
24
 
25
25
  it "supports pagination" do
@@ -41,7 +41,7 @@ describe Dnsimple::Client, ".domains" do
41
41
  end
42
42
 
43
43
  it "supports filtering" do
44
- subject.domains(account_id, filter: { name_like: 'example' })
44
+ subject.domains(account_id, filter: { name_like: "example" })
45
45
 
46
46
  expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/domains?name_like=example")
47
47
  end
@@ -111,7 +111,7 @@ describe Dnsimple::Client, ".domains" do
111
111
 
112
112
  expect(WebMock).to have_requested(:post, "https://api.dnsimple.test/v2/#{account_id}/domains")
113
113
  .with(body: attributes)
114
- .with(headers: { 'Accept' => 'application/json' })
114
+ .with(headers: { "Accept" => "application/json" })
115
115
  end
116
116
 
117
117
  it "returns the domain" do
@@ -136,7 +136,7 @@ describe Dnsimple::Client, ".domains" do
136
136
  subject.domain(account_id, domain = "example-alpha.com")
137
137
 
138
138
  expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain}")
139
- .with(headers: { 'Accept' => 'application/json' })
139
+ .with(headers: { "Accept" => "application/json" })
140
140
  end
141
141
 
142
142
  it "returns the domain" do
@@ -181,7 +181,7 @@ describe Dnsimple::Client, ".domains" do
181
181
  subject.delete_domain(account_id, domain = "example.com")
182
182
 
183
183
  expect(WebMock).to have_requested(:delete, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain}")
184
- .with(headers: { 'Accept' => 'application/json' })
184
+ .with(headers: { "Accept" => "application/json" })
185
185
  end
186
186
 
187
187
  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, ".identity" do
6
6
 
@@ -17,7 +17,7 @@ describe Dnsimple::Client, ".identity" do
17
17
  subject.whoami
18
18
 
19
19
  expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/whoami")
20
- .with(headers: { 'Accept' => 'application/json' })
20
+ .with(headers: { "Accept" => "application/json" })
21
21
  end
22
22
 
23
23
  it "returns the whoami" do