Skip to content

Commit be37bc1

Browse files
committed
Test added
1 parent db74ffd commit be37bc1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

spec/shared_stripe_examples/subscription_examples.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,6 +1119,18 @@
11191119
expect(e.message).to eq("Invalid timestamp: must be an integer")
11201120
}
11211121
end
1122+
1123+
it "converts billing_cycle_anchor=now to a timestamp" do
1124+
customer = Stripe::Customer.create(id: 'test_billing_anchor', plan: plan.id, source: gen_card_tk)
1125+
1126+
sub = Stripe::Subscription.retrieve(customer.subscriptions.data.first.id)
1127+
sub.billing_cycle_anchor = 'now'
1128+
sub.save
1129+
1130+
expect(sub.billing_cycle_anchor).to be_a(Integer)
1131+
end
1132+
1133+
11221134
end
11231135

11241136
context "cancelling a subscription" do

0 commit comments

Comments
 (0)