Sha256: def9df5d08bcdcb61ea1d68e5e9a189a074f645d68bac067ec0ed955c4eb5d70

Contents?: true

Size: 771 Bytes

Versions: 21

Compression:

Stored size: 771 Bytes

Contents

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

module Stripe
  class InvoiceItemTest < Test::Unit::TestCase
    should "retrieve should retrieve invoice items" do
      @mock.expects(:get).once.returns(make_response(make_invoice_item))
      ii = Stripe::InvoiceItem.retrieve('in_test_invoice_item')
      assert_equal 'ii_test_invoice_item', ii.id
    end

    should "invoice items should be updateable" do
      @mock.expects(:post).once.
        with('https://api.stripe.com/v1/invoiceitems/test_invoice_item', nil, 'metadata[foo]=bar').
        returns(make_response(make_charge(metadata: {'foo' => 'bar'})))
      ii = Stripe::InvoiceItem.update("test_invoice_item", metadata: {foo: 'bar'})
      assert_equal('bar', ii.metadata['foo'])
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
stripe-1.58.0 test/stripe/invoice_item_test.rb
stripe-1.57.1 test/stripe/invoice_item_test.rb
stripe-1.57.0 test/stripe/invoice_item_test.rb
stripe-1.56.2 test/stripe/invoice_item_test.rb
stripe-1.56.1 test/stripe/invoice_item_test.rb
stripe-1.56.0 test/stripe/invoice_item_test.rb
stripe-1.55.1 test/stripe/invoice_item_test.rb
stripe-1.55.0 test/stripe/invoice_item_test.rb
stripe-1.54.0 test/stripe/invoice_item_test.rb
stripe-1.53.0 test/stripe/invoice_item_test.rb
stripe-1.52.0 test/stripe/invoice_item_test.rb
stripe-1.51.1 test/stripe/invoice_item_test.rb
stripe-1.51.0 test/stripe/invoice_item_test.rb
stripe-1.50.1 test/stripe/invoice_item_test.rb
stripe-1.50.0 test/stripe/invoice_item_test.rb
stripe-1.49.0 test/stripe/invoice_item_test.rb
stripe-1.48.0 test/stripe/invoice_item_test.rb
stripe-1.47.0 test/stripe/invoice_item_test.rb
stripe-1.46.0 test/stripe/invoice_item_test.rb
stripe-1.45.0 test/stripe/invoice_item_test.rb