Sha256: 5100d18110d1f70b25f28a498e51c4578af18af3d16aea5eda2bbb05506490fb

Contents?: true

Size: 811 Bytes

Versions: 20

Compression:

Stored size: 811 Bytes

Contents

# frozen_string_literal: true

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

module Stripe
  class UsageRecordSummaryTest < Test::Unit::TestCase
    setup do
      @sub_item = Stripe::SubscriptionItem.retrieve("si_123")
    end

    should "be listable" do
      old_stderr = $stderr
      $stderr = StringIO.new

      begin
        transactions = @sub_item.usage_record_summaries

        assert_requested :get, "#{Stripe.api_base}/v1/subscription_items/#{@sub_item.id}/usage_record_summaries"
        assert transactions.data.is_a?(Array)
        assert transactions.first.is_a?(Stripe::UsageRecordSummary)

        assert_include $stderr.string,
                       "use SubscriptionItem.list_usage_record_summaries instead"
      ensure
        $stderr = old_stderr
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
stripe-5.31.0 test/stripe/usage_record_summary_test.rb
stripe-5.30.0 test/stripe/usage_record_summary_test.rb
stripe-5.29.1 test/stripe/usage_record_summary_test.rb
stripe-5.29.0 test/stripe/usage_record_summary_test.rb
stripe-5.28.0 test/stripe/usage_record_summary_test.rb
stripe-5.27.0 test/stripe/usage_record_summary_test.rb
stripe-5.26.0 test/stripe/usage_record_summary_test.rb
stripe-5.25.0 test/stripe/usage_record_summary_test.rb
stripe-5.24.0 test/stripe/usage_record_summary_test.rb
stripe-5.23.1 test/stripe/usage_record_summary_test.rb
stripe-5.23.0 test/stripe/usage_record_summary_test.rb
stripe-5.22.0 test/stripe/usage_record_summary_test.rb
stripe-5.21.0 test/stripe/usage_record_summary_test.rb
stripe-5.20.0 test/stripe/usage_record_summary_test.rb
stripe-5.19.0 test/stripe/usage_record_summary_test.rb
stripe-5.18.0 test/stripe/usage_record_summary_test.rb
stripe-5.17.0 test/stripe/usage_record_summary_test.rb
stripe-5.16.0 test/stripe/usage_record_summary_test.rb
stripe-5.15.0 test/stripe/usage_record_summary_test.rb
stripe-5.14.0 test/stripe/usage_record_summary_test.rb