Skip to content

Commit

Permalink
Fix and add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
remi-stripe committed Sep 30, 2020
1 parent 8c09649 commit f054ba1
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ notifications:
env:
global:
# If changing this number, please also change it in `test/test_helper.rb`.
- STRIPE_MOCK_VERSION=0.98.0
- STRIPE_MOCK_VERSION=0.99.0

cache:
directories:
Expand Down
3 changes: 1 addition & 2 deletions test/stripe/product_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ class ProductTest < Test::Unit::TestCase

should "be creatable" do
product = Stripe::Product.create(
name: "My Product",
type: "good"
name: "My Product"
)
assert_requested :post, "#{Stripe.api_base}/v1/products"
assert product.is_a?(Stripe::Product)
Expand Down
18 changes: 18 additions & 0 deletions test/stripe/setup_attempt_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# frozen_string_literal: true

require ::File.expand_path("../test_helper", __dir__)

module Stripe
class SetupAttemptTest < Test::Unit::TestCase
TEST_RESOURCE_ID = "seti_123"

should "be listable" do
setup_attempts = Stripe::SetupAttempt.list({
setup_intent: "seti_123",
})
assert_requested :get, "#{Stripe.api_base}/v1/setup_attempts?setup_intent=seti_123"
assert setup_attempts.data.is_a?(Array)
assert setup_attempts.data[0].is_a?(Stripe::SetupAttempt)
end
end
end
2 changes: 1 addition & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
require ::File.expand_path("stripe_mock", __dir__)

# If changing this number, please also change it in `.travis.yml`.
MOCK_MINIMUM_VERSION = "0.98.0"
MOCK_MINIMUM_VERSION = "0.99.0"
MOCK_PORT = Stripe::StripeMock.start

# Disable all real network connections except those that are outgoing to
Expand Down

0 comments on commit f054ba1

Please sign in to comment.