Update stripe tests for newer API format.

This commit is contained in:
Ross Boucher 2011-09-15 14:09:03 -07:00
parent 73a884f202
commit 5fcaa49495
2 changed files with 5 additions and 5 deletions

View File

@ -57,7 +57,7 @@ def test_customer(params={})
end
def test_customer_array
[test_customer, test_customer, test_customer]
{:data => [test_customer, test_customer, test_customer]}
end
def test_charge(params={})
@ -84,7 +84,7 @@ def test_charge(params={})
end
def test_charge_array
[test_charge, test_charge, test_charge]
{:data => [test_charge, test_charge, test_charge]}
end
def test_card(params={})

View File

@ -153,7 +153,7 @@ class TestStripeRuby < Test::Unit::TestCase
should "loading all of an APIResource should return an array of recursively instantiated objects" do
@mock.expects(:get).once.returns(test_response(test_charge_array))
c = Stripe::Charge.all
c = Stripe::Charge.all.data
assert c.kind_of? Array
assert c[0].kind_of? Stripe::Charge
assert c[0].card.kind_of?(Stripe::StripeObject) && c[0].card.object == 'card'
@ -163,7 +163,7 @@ class TestStripeRuby < Test::Unit::TestCase
should "charges should be listable" do
@mock.expects(:get).once.returns(test_response(test_charge_array))
c = Stripe::Charge.all
c = Stripe::Charge.all.data
assert c.kind_of? Array
end
@ -223,7 +223,7 @@ class TestStripeRuby < Test::Unit::TestCase
should "customers should be listable" do
@mock.expects(:get).once.returns(test_response(test_customer_array))
c = Stripe::Customer.all
c = Stripe::Customer.all.data
assert c.kind_of? Array
assert c[0].kind_of? Stripe::Customer
end