Sha256: 7717f277ceb8ca4cca32fb4c69d1e7d69e90a2bde04da9bf71429eca4cc973d1

Contents?: true

Size: 1.29 KB

Versions: 8

Compression:

Stored size: 1.29 KB

Contents

require File.expand_path('../../test_helper', __FILE__)

module Stripe
  class ApplePayDomainTest < Test::Unit::TestCase
    should "create should return a new Apple Pay domain" do
      @mock.expects(:post).once
           .with('https://api.stripe.com/v1/apple_pay/domains', nil, '')
           .returns(make_response(make_apple_pay_domain))
      d = Stripe::ApplePayDomain.create
      assert_equal "apwc_test_domain", d.id
    end

    should "domains should be deletable" do
      @mock.expects(:get).once
           .with('https://api.stripe.com/v1/apple_pay/domains/apwc_test_domain', nil, nil)
           .returns(make_response(make_apple_pay_domain))
      @mock.expects(:delete).once.returns(make_response(make_apple_pay_domain(:deleted => true)))
      domain = Stripe::ApplePayDomain.retrieve('apwc_test_domain')
      domain.delete
      assert domain.deleted
    end

    should "domains should be listable" do
      @mock.expects(:get).once.with('https://api.stripe.com/v1/apple_pay/domains', nil, nil)
           .returns(make_response(make_apple_pay_domain_array))
      domains = Stripe::ApplePayDomain.list
      assert domains.data.kind_of?(Array)
      assert_equal 3, domains.data.length
      domains.each do |domain|
        assert domain.kind_of?(Stripe::ApplePayDomain)
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
stripe-1.58.0 test/stripe/apple_pay_domain_test.rb
stripe-1.57.1 test/stripe/apple_pay_domain_test.rb
stripe-1.57.0 test/stripe/apple_pay_domain_test.rb
stripe-1.56.2 test/stripe/apple_pay_domain_test.rb
stripe-1.56.1 test/stripe/apple_pay_domain_test.rb
stripe-1.56.0 test/stripe/apple_pay_domain_test.rb
stripe-1.55.1 test/stripe/apple_pay_domain_test.rb
stripe-1.55.0 test/stripe/apple_pay_domain_test.rb