stripe-ruby/test/stripe/coupon_test.rb
2015-07-02 11:51:38 -07:00

21 lines
617 B
Ruby

require File.expand_path('../../test_helper', __FILE__)
module Stripe
class CouponTest < Test::Unit::TestCase
should "create should return a new coupon" do
@mock.expects(:post).once.returns(make_response(make_coupon))
c = Stripe::Coupon.create
assert_equal "co_test_coupon", c.id
end
should "coupons should be updateable" do
@mock.expects(:get).once.returns(make_response(make_coupon))
@mock.expects(:post).once.returns(make_response(make_coupon))
c = Stripe::Coupon.new("test_coupon")
c.refresh
c.metadata['foo'] = 'bar'
c.save
end
end
end