Skip to content

Commit c269993

Browse files
authored
Remove manual promotion code test (stripe#1691)
* removed promotion_code_test.rb (will be fully tested by generated_examples_test) * regenerated generated_examples_test.rb
1 parent d25eb52 commit c269993

2 files changed

Lines changed: 22 additions & 43 deletions

File tree

test/stripe/generated_examples_test.rb

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff 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"

test/stripe/promotion_code_test.rb

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)