Skip to content

Commit

Permalink
Drop the unexistent domain#reset_domain_token method
Browse files Browse the repository at this point in the history
See dnsimple/dnsimple-developer#187 and
https://github.com/dnsimple/dnsimple-app/pull/14061

We dropped the method from the API but we didn't remove it from some
clients. This commit drops this unexistent method.
  • Loading branch information
duduribeiro committed Apr 12, 2021
1 parent 54ad1a4 commit f291597
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 62 deletions.
18 changes: 0 additions & 18 deletions lib/dnsimple/client/domains.rb
Expand Up @@ -114,24 +114,6 @@ def delete_domain(account_id, domain_id, options = {})

Dnsimple::Response.new(response, nil)
end

# Resets the domain token.
#
# @see https://developer.dnsimple.com/v2/domains/#reset-token
#
# @param [Integer] account_id the account ID
# @param [#to_s] domain_id The domain ID or domain name
# @param [Hash] options
# @return [Dnsimple::Response<nil>]
#
# @raise [Dnsimple::NotFoundError]
# @raise [Dnsimple::RequestError]
def reset_domain_token(account_id, domain_id, options = {})
response = client.post(Client.versioned("/%s/domains/%s/token" % [account_id, domain_id]), nil, options)

Dnsimple::Response.new(response, Struct::Domain.new(response["data"]))
end

end
end
end
27 changes: 0 additions & 27 deletions spec/dnsimple/client/domains_spec.rb
Expand Up @@ -204,31 +204,4 @@
end
end
end

describe "#reset_domain_token" do
let(:account_id) { 1010 }
let(:domain_id) { "example.com" }

before do
stub_request(:post, %r{/v2/#{account_id}/domains/#{domain_id}/token})
.to_return(read_http_fixture("resetDomainToken/success.http"))
end

it "builds the correct request" do
subject.reset_domain_token(account_id, domain_id)

expect(WebMock).to have_requested(:post, "https://api.dnsimple.test/v2/#{account_id}/domains/#{domain_id}/token")
.with(headers: { 'Accept' => 'application/json' })
end

it "returns the domain" do
response = subject.reset_domain_token(account_id, domain_id)
expect(response).to be_a(Dnsimple::Response)

result = response.data
expect(result).to be_a(Dnsimple::Struct::Domain)
expect(result.id).to be_a(Integer)
end
end

end
17 changes: 0 additions & 17 deletions spec/fixtures.http/resetDomainToken/success.http

This file was deleted.

0 comments on commit f291597

Please sign in to comment.