mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-10-08 00:02:46 -04:00
Fix order of assert_equal calls that were backwards
This commit is contained in:
parent
218178ea54
commit
650179b2aa
@ -20,10 +20,10 @@ module Stripe
|
|||||||
@mock.expects(:get).once.returns(test_response(test_customer({:mnemonic => "foo"})))
|
@mock.expects(:get).once.returns(test_response(test_customer({:mnemonic => "foo"})))
|
||||||
@mock.expects(:post).once.returns(test_response(test_customer({:mnemonic => "bar"})))
|
@mock.expects(:post).once.returns(test_response(test_customer({:mnemonic => "bar"})))
|
||||||
c = Stripe::Customer.new("test_customer").refresh
|
c = Stripe::Customer.new("test_customer").refresh
|
||||||
assert_equal c.mnemonic, "foo"
|
assert_equal "foo", c.mnemonic
|
||||||
c.mnemonic = "bar"
|
c.mnemonic = "bar"
|
||||||
c.save
|
c.save
|
||||||
assert_equal c.mnemonic, "bar"
|
assert_equal "bar", c.mnemonic
|
||||||
end
|
end
|
||||||
|
|
||||||
should "create should return a new customer" do
|
should "create should return a new customer" do
|
||||||
|
@ -20,7 +20,7 @@ module Stripe
|
|||||||
|
|
||||||
@mock.expects(:post).once.with('https://api.stripe.com/v1/invoices/in_test_invoice/pay', nil, '').returns(test_response(test_paid_invoice))
|
@mock.expects(:post).once.with('https://api.stripe.com/v1/invoices/in_test_invoice/pay', nil, '').returns(test_response(test_paid_invoice))
|
||||||
i.pay
|
i.pay
|
||||||
assert_equal i.next_payment_attempt, nil
|
assert_equal nil, i.next_payment_attempt
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -12,9 +12,9 @@ module Stripe
|
|||||||
should "marshal a stripe object correctly" do
|
should "marshal a stripe object correctly" do
|
||||||
obj = Stripe::StripeObject.construct_from({ :id => 1, :name => 'Stripe' }, 'apikey')
|
obj = Stripe::StripeObject.construct_from({ :id => 1, :name => 'Stripe' }, 'apikey')
|
||||||
m = Marshal.load(Marshal.dump(obj))
|
m = Marshal.load(Marshal.dump(obj))
|
||||||
assert_equal m.id, 1
|
assert_equal 1, m.id
|
||||||
assert_equal m.name, 'Stripe'
|
assert_equal 'Stripe', m.name
|
||||||
assert_equal m.api_key, 'apikey'
|
assert_equal 'apikey', m.api_key
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -17,7 +17,7 @@ module Stripe
|
|||||||
subscription = customer.subscriptions.first
|
subscription = customer.subscriptions.first
|
||||||
subscription.refresh
|
subscription.refresh
|
||||||
|
|
||||||
assert_equal subscription.id, 'refreshed_subscription'
|
assert_equal 'refreshed_subscription', subscription.id
|
||||||
end
|
end
|
||||||
|
|
||||||
should "subscriptions should be deletable" do
|
should "subscriptions should be deletable" do
|
||||||
@ -38,12 +38,12 @@ module Stripe
|
|||||||
|
|
||||||
customer = Stripe::Customer.retrieve('test_customer')
|
customer = Stripe::Customer.retrieve('test_customer')
|
||||||
subscription = customer.subscriptions.first
|
subscription = customer.subscriptions.first
|
||||||
assert_equal subscription.status, 'trialing'
|
assert_equal 'trialing', subscription.status
|
||||||
|
|
||||||
subscription.status = 'active'
|
subscription.status = 'active'
|
||||||
subscription.save
|
subscription.save
|
||||||
|
|
||||||
assert_equal subscription.status, 'active'
|
assert_equal 'active', subscription.status
|
||||||
end
|
end
|
||||||
|
|
||||||
should "create should return a new subscription" do
|
should "create should return a new subscription" do
|
||||||
@ -52,7 +52,7 @@ module Stripe
|
|||||||
|
|
||||||
customer = Stripe::Customer.retrieve('test_customer')
|
customer = Stripe::Customer.retrieve('test_customer')
|
||||||
subscription = customer.subscriptions.create(:plan => 'silver')
|
subscription = customer.subscriptions.create(:plan => 'silver')
|
||||||
assert_equal subscription.id, 'test_new_subscription'
|
assert_equal 'test_new_subscription', subscription.id
|
||||||
end
|
end
|
||||||
|
|
||||||
should "be able to delete a subscriptions's discount" do
|
should "be able to delete a subscriptions's discount" do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user