Sha256: c3277dfdebbf652af62642ea14d72aed4e8b0382584c691e57b69d8be55e7c69

Contents?: true

Size: 1.46 KB

Versions: 7

Compression:

Stored size: 1.46 KB

Contents

# frozen_string_literal: true

require ::File.expand_path("../../test_helper", __FILE__)

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
stripe-4.18.0 test/stripe/apple_pay_domain_test.rb
stripe-4.17.0 test/stripe/apple_pay_domain_test.rb
stripe-4.16.0 test/stripe/apple_pay_domain_test.rb
stripe-4.15.0 test/stripe/apple_pay_domain_test.rb
stripe-4.14.0 test/stripe/apple_pay_domain_test.rb
stripe-4.13.0 test/stripe/apple_pay_domain_test.rb
stripe-4.12.0 test/stripe/apple_pay_domain_test.rb