mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-10-26 00:00:44 -04:00
* Bump Rubocop to 0.57.2
* Style/StderrPuts: Use warn instead of .puts
* Style/ExpandPathArguments: Use expand_path('../test_helper', __dir__) instead of expand_path('../../test_helper', __FILE__)
* Style/Encoding: Unnecessary utf-8 encoding comment
* Style/StringLiterals: Prefer double-quoted strings
* Style/AccessModifierDeclarations
* Style/FormatStringToken: Prefer annotated tokens
* Naming/UncommunicativeMethodParamName
* Metrics/LineLength: set maximum line length to 100 characters
* Style/IfUnlessModifier: Favor modifier if usage when having a single-line body
* Style/ClassVars
* Metrics/LineLength: set maximum line length to 80 characters (default)
* Style/AccessModifierDeclarations: EnforcedStyle: inline
47 lines
1.5 KiB
Ruby
47 lines
1.5 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
require ::File.expand_path("../test_helper", __dir__)
|
|
|
|
module Stripe
|
|
class ApplePayDomainTest < Test::Unit::TestCase
|
|
should "be listable" do
|
|
domains = Stripe::ApplePayDomain.list
|
|
assert_requested :get, "#{Stripe.api_base}/v1/apple_pay/domains"
|
|
assert domains.data.is_a?(Array)
|
|
assert domains.data[0].is_a?(Stripe::ApplePayDomain)
|
|
end
|
|
|
|
should "be retrievable" do
|
|
domain = Stripe::ApplePayDomain.retrieve("apwc_123")
|
|
assert_requested :get, "#{Stripe.api_base}/v1/apple_pay/domains/apwc_123"
|
|
assert domain.is_a?(Stripe::ApplePayDomain)
|
|
end
|
|
|
|
should "be creatable" do
|
|
domain = Stripe::ApplePayDomain.create(domain_name: "example.com")
|
|
assert_requested :post, "#{Stripe.api_base}/v1/apple_pay/domains"
|
|
assert domain.is_a?(Stripe::ApplePayDomain)
|
|
end
|
|
|
|
should "be deletable" do
|
|
end
|
|
|
|
context "#delete" do
|
|
should "be deletable" do
|
|
domain = Stripe::ApplePayDomain.retrieve("apwc_123")
|
|
domain = domain.delete
|
|
assert_requested :delete, "#{Stripe.api_base}/v1/apple_pay/domains/#{domain.id}"
|
|
assert domain.is_a?(Stripe::ApplePayDomain)
|
|
end
|
|
end
|
|
|
|
context ".delete" do
|
|
should "be deletable" do
|
|
domain = Stripe::ApplePayDomain.delete("apwc_123")
|
|
assert_requested :delete, "#{Stripe.api_base}/v1/apple_pay/domains/apwc_123"
|
|
assert domain.is_a?(Stripe::ApplePayDomain)
|
|
end
|
|
end
|
|
end
|
|
end
|