mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-10-05 00:02:50 -04:00
21 lines
617 B
Ruby
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
|