File tree Expand file tree Collapse file tree 6 files changed +24
-15
lines changed Expand file tree Collapse file tree 6 files changed +24
-15
lines changed Original file line number Diff line number Diff line change 1
1
## Unreleased
2
2
3
+ - Fix some deprecation warnings in tests. Thanks @smtlaissezfaire !
4
+ - Fix ` NameError when loading JavascriptHelper ` . Thanks @smtlaissezfaire !
5
+
3
6
## 2.3.4 (2022-05-03)
4
7
5
8
- Add setup_intent.canceled and setup_intent.requires_action callbacks. Thanks @jamesjason !
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ def stripe_config.api_key=(key)
79
79
end
80
80
end
81
81
82
- initializer 'stripe.javascript_helper' do
82
+ config . to_prepare do
83
83
ActiveSupport . on_load :action_controller do
84
84
# ActionController::API does not have a helper method
85
85
if respond_to? ( :helper )
Original file line number Diff line number Diff line change 307
307
308
308
describe 'when passed invalid arguments for tiered pricing' do
309
309
it 'raises a Stripe::InvalidConfigurationError when billing tiers are invalid' do
310
- lambda {
310
+ _ ( lambda {
311
311
Stripe . plan "Bad Tiers" . to_sym do |plan |
312
312
plan . name = 'Acme as a service BAD TIERS'
313
313
plan . constant_name = 'BAD_TIERS'
328
328
}
329
329
]
330
330
end
331
- } . must_raise Stripe ::InvalidConfigurationError
331
+ } ) . must_raise Stripe ::InvalidConfigurationError
332
332
end
333
333
334
334
it 'raises a Stripe::InvalidConfigurationError when billing tiers is not an array' do
335
- lambda {
335
+ _ ( lambda {
336
336
Stripe . plan "Bad Tiers" . to_sym do |plan |
337
337
plan . name = 'Acme as a service BAD TIERS'
338
338
plan . constant_name = 'BAD_TIERS'
348
348
up_to : 10
349
349
}
350
350
end
351
- } . must_raise Stripe ::InvalidConfigurationError
351
+ } ) . must_raise Stripe ::InvalidConfigurationError
352
352
end
353
353
end
354
354
Original file line number Diff line number Diff line change 392
392
393
393
describe 'when passed invalid arguments for tiered pricing' do
394
394
it 'raises a Stripe::InvalidConfigurationError when billing tiers are invalid' do
395
- lambda {
395
+ _ ( lambda {
396
396
Stripe . price "Bad Tiers" . to_sym do |price |
397
397
price . name = 'Acme as a service BAD TIERS'
398
398
price . constant_name = 'BAD_TIERS'
414
414
}
415
415
]
416
416
end
417
- } . must_raise Stripe ::InvalidConfigurationError
417
+ } ) . must_raise Stripe ::InvalidConfigurationError
418
418
end
419
419
420
420
it 'raises a Stripe::InvalidConfigurationError when billing tiers is not an array' do
421
- lambda {
421
+ _ ( lambda {
422
422
Stripe . price "Bad Tiers" . to_sym do |price |
423
423
price . name = 'Acme as a service BAD TIERS'
424
424
price . constant_name = 'BAD_TIERS'
435
435
up_to : 10
436
436
}
437
437
end
438
- } . must_raise Stripe ::InvalidConfigurationError
438
+ } ) . must_raise Stripe ::InvalidConfigurationError
439
439
end
440
440
end
441
441
Original file line number Diff line number Diff line change 34
34
end
35
35
36
36
Stripe ::Engine . testing = true
37
- require 'mocha/setup '
37
+ require 'mocha/minitest '
38
38
39
39
require 'irb'
Original file line number Diff line number Diff line change 4
4
i_suck_and_my_tests_are_order_dependent! # the default test must be run first!
5
5
6
6
# NOTE: skipped `stripe.plans_and_coupons` to prevent warnings about constants
7
- STRIPE_INITIALIZER_NAMES = %w{ stripe.configure.defaults stripe.configure stripe.callbacks.eager_load stripe.javascript_helper }
7
+ STRIPE_INITIALIZER_NAMES = %w{
8
+ stripe.configure.defaults
9
+ stripe.configure
10
+ stripe.callbacks.eager_load
11
+ }
8
12
9
13
let ( :app ) { Rails . application }
10
14
let ( :initializers ) { STRIPE_INITIALIZER_NAMES . map { |name | app . initializers . find { |ini | ini . name == name } } }
11
15
12
- def rerun_initializers! ; initializers . each { |init | init . run ( app ) } ; end
16
+ def rerun_initializers!
17
+ initializers . each { |init | init . run ( app ) }
18
+ end
13
19
14
20
after do
15
21
Stripe . api_version = nil
@@ -60,11 +66,11 @@ def rerun_initializers!; initializers.each{|init| init.run(app) }; end
60
66
it "supports nil signing_secret" do
61
67
subject
62
68
63
- app . config . stripe . signing_secret = nil
69
+ app . config . stripe . signing_secret = nil
64
70
rerun_initializers!
65
71
66
- _ ( app . config . stripe . signing_secret ) . must_equal nil
67
- _ ( app . config . stripe . signing_secrets ) . must_equal nil
72
+ assert_nil app . config . stripe . signing_secret
73
+ assert_nil app . config . stripe . signing_secrets
68
74
end
69
75
70
76
it "supports multiple signing secrets" do
You can’t perform that action at this time.
0 commit comments