stripe-ruby/test/stripe/apple_pay_domain_test.rb
Brandur 3f549fb5ad Port all tests over to OpenAPI
Follows the path established in 2d75c8f by porting the rest of
stripe-ruby's tests over to OpenAPI. There are a few other changes here
where I've removed some tests that are duplicated or don't make much
sense, or reorganized how we test certain things, but this commit is
largely the same migration operation applied in bulk a few dozen test
suites.
2017-02-14 12:17:37 -08:00

34 lines
1.2 KiB
Ruby

require File.expand_path('../../test_helper', __FILE__)
module Stripe
class ApplePayDomainTest < Test::Unit::TestCase
FIXTURE = API_FIXTURES.fetch(:apple_pay_domain)
should "be listable" do
domains = Stripe::ApplePayDomain.list
assert_requested :get, "#{Stripe.api_base}/v1/apple_pay/domains"
assert domains.data.kind_of?(Array)
assert domains.data[0].kind_of?(Stripe::ApplePayDomain)
end
should "be retrievable" do
domain = Stripe::ApplePayDomain.retrieve(FIXTURE[:id])
assert_requested :get, "#{Stripe.api_base}/v1/apple_pay/domains/#{FIXTURE[:id]}"
assert domain.kind_of?(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.kind_of?(Stripe::ApplePayDomain)
end
should "be deletable" do
domain = Stripe::ApplePayDomain.retrieve(FIXTURE[:id])
domain = domain.delete
assert_requested :delete, "#{Stripe.api_base}/v1/apple_pay/domains/#{FIXTURE[:id]}"
assert domain.kind_of?(Stripe::ApplePayDomain)
end
end
end