test/stripe/subscription_schedule_test.rb in stripe-4.11.0 vs test/stripe/subscription_schedule_test.rb in stripe-4.12.0

- old
+ new

@@ -49,16 +49,45 @@ "#{Stripe.api_base}/v1/subscription_schedules/#{schedule.id}/cancel" assert schedule.is_a?(Stripe::SubscriptionSchedule) end end + context ".cancel" do + should "cancel a subscription schedule" do + schedule = Stripe::SubscriptionSchedule.cancel("sub_sched_123") + assert_requested :post, + "#{Stripe.api_base}/v1/subscription_schedules/sub_sched_123/cancel" + assert schedule.is_a?(Stripe::SubscriptionSchedule) + end + end + context "#release" do should "release a subscription schedule" do schedule = Stripe::SubscriptionSchedule.retrieve("sub_sched_123") schedule = schedule.release assert_requested :post, "#{Stripe.api_base}/v1/subscription_schedules/#{schedule.id}/release" assert schedule.is_a?(Stripe::SubscriptionSchedule) + end + end + + context ".release" do + should "release a subscription schedule" do + schedule = Stripe::SubscriptionSchedule.release("sub_sched_123") + assert_requested :post, + "#{Stripe.api_base}/v1/subscription_schedules/sub_sched_123/release" + assert schedule.is_a?(Stripe::SubscriptionSchedule) + end + end + + context "#revisions" do + should "retrieve the subscription schedule's revisions" do + schedule = Stripe::SubscriptionSchedule.retrieve("sub_sched_123") + revisions = schedule.revisions + assert_requested :get, + "#{Stripe.api_base}/v1/subscription_schedules/sub_sched_123/revisions" + assert revisions.data.is_a?(Array) + assert revisions.data[0].is_a?(Stripe::SubscriptionScheduleRevision) end end end end