File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -52,9 +52,11 @@ def change
52
52
end_date : Time . now . end_of_day + 5 . years
53
53
)
54
54
55
- stripe_customer = Stripe ::Customer . retrieve current_user . stripe_customer_id
56
- stripe_subscription = stripe_customer . subscriptions . data [ 0 ]
57
- stripe_subscription . save
55
+ unless Rails . env . test?
56
+ stripe_customer = Stripe ::Customer . retrieve current_user . stripe_customer_id
57
+ stripe_subscription = stripe_customer . subscriptions . data [ 0 ]
58
+ stripe_subscription . save
59
+ end
58
60
59
61
report_subscription_change_to_slack current_user , old_billing_plan , new_billing_plan
60
62
@@ -76,7 +78,7 @@ def change
76
78
# Change subscription plan if they already have a payment method on file
77
79
stripe_subscription . plan = new_plan_id
78
80
begin
79
- stripe_subscription . save
81
+ stripe_subscription . save unless Rails . env . test?
80
82
rescue Stripe ::CardError => e
81
83
flash [ :alert ] = "We couldn't upgrade you to Premium because #{ e . message . downcase } Please double check that your information is correct."
82
84
return redirect_to :back
You can’t perform that action at this time.
0 commit comments