File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3843,13 +3843,34 @@ class CodegennedExampleTest < Test::Unit::TestCase
38433843 assert_requested :get , "#{ Stripe ::DEFAULT_API_BASE } /v1/promotion_codes/promo_xxxxxxxxxxxxx"
38443844 end
38453845 should "Test promotion codes post" do
3846+ promotion_code = Stripe ::PromotionCode . create ( {
3847+ promotion : {
3848+ type : "coupon" ,
3849+ coupon : "Z4OV52SU" ,
3850+ } ,
3851+ } )
3852+ assert_requested :post , "#{ Stripe . api_base } /v1/promotion_codes"
3853+ end
3854+ should "Test promotion codes post (service)" do
3855+ stub_request ( :post , "#{ Stripe ::DEFAULT_API_BASE } /v1/promotion_codes" ) . to_return ( body : "{}" )
3856+ client = Stripe ::StripeClient . new ( "sk_test_123" )
3857+
3858+ promotion_code = client . v1 . promotion_codes . create ( {
3859+ promotion : {
3860+ type : "coupon" ,
3861+ coupon : "Z4OV52SU" ,
3862+ } ,
3863+ } )
3864+ assert_requested :post , "#{ Stripe ::DEFAULT_API_BASE } /v1/promotion_codes"
3865+ end
3866+ should "Test promotion codes post 2" do
38463867 promotion_code = Stripe ::PromotionCode . update (
38473868 "promo_xxxxxxxxxxxxx" ,
38483869 { metadata : { order_id : "6735" } }
38493870 )
38503871 assert_requested :post , "#{ Stripe . api_base } /v1/promotion_codes/promo_xxxxxxxxxxxxx"
38513872 end
3852- should "Test promotion codes post (service)" do
3873+ should "Test promotion codes post 2 (service)" do
38533874 stub_request (
38543875 :post ,
38553876 "#{ Stripe ::DEFAULT_API_BASE } /v1/promotion_codes/promo_xxxxxxxxxxxxx"
Load diff This file was deleted.
You can’t perform that action at this time.
0 commit comments