Sha256: 64f0b2c1659ef6074a970e83ac7c7aea490c00c9afada03dffa6670bb7e9f847

Contents?: true

Size: 1.13 KB

Versions: 13

Compression:

Stored size: 1.13 KB

Contents

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

module Payjp
  class TransferTest < Test::Unit::TestCase
    should "transfers should be listable" do
      @mock.expects(:get).once.returns(test_response(test_transfer_array))
      c = Payjp::Transfer.all.data
      assert c.is_a? Array
      assert c[0].is_a? Payjp::Transfer
    end

    should "retrieve should retrieve transfer" do
      @mock.expects(:get).once.returns(test_response(test_transfer))
      transfer = Payjp::Transfer.retrieve('tr_test_transfer')
      assert_equal 'tr_test_transfer', transfer.id
    end

    should "transfers should not be deletable" do
      assert_raises NoMethodError do
        @mock.expects(:get).once.returns(test_response(test_transfer))
        transfer = Payjp::Transfer.retrieve('tr_test_transfer')
        transfer.delete
      end
    end

    should "transfer.charges should return charge list" do
      @mock.expects(:get).once.returns(test_response(test_transfer))
      transfer = Payjp::Transfer.retrieve('tr_test_transfer')
      c = transfer.charges.data
      assert c.is_a? Array
      assert c[0].is_a? Payjp::Charge
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
payjp-0.0.16 test/payjp/transfer_test.rb
payjp-0.0.14 test/payjp/transfer_test.rb
payjp-0.0.13 test/payjp/transfer_test.rb
payjp-0.0.12 test/payjp/transfer_test.rb
payjp-0.0.10 test/payjp/transfer_test.rb
payjp-0.0.9 test/payjp/transfer_test.rb
payjp-0.0.8 test/payjp/transfer_test.rb
payjp-0.0.7 test/payjp/transfer_test.rb
payjp-0.0.6 test/payjp/transfer_test.rb
payjp-0.0.5 test/payjp/transfer_test.rb
payjp-0.0.4 test/payjp/transfer_test.rb
payjp-0.0.3 test/payjp/transfer_test.rb
payjp-0.0.2 test/payjp/transfer_test.rb