test/pagarme/resources/subscription_test.rb in pagarme-2.1.2 vs test/pagarme/resources/subscription_test.rb in pagarme-2.1.3
- old
+ new
@@ -1,9 +1,9 @@
require_relative '../../test_helper'
module PagarMe
- class SubscriptionTest < Test::Unit::TestCase
+ class SubscriptionTest < PagarMeTestCase
should 'be able to create subscription with plan' do
plan = PagarMe::Plan.create plan_params
assert_plan_created plan
subscription = PagarMe::Subscription.create subscription_with_customer_params(plan: plan)
@@ -37,11 +37,11 @@
should 'be able to create subscription without plan' do
subscription = PagarMe::Subscription.create subscription_with_customer_with_card_params(amount: 2000)
assert_subscription_successfully_paid subscription, 2000
found_subscription = PagarMe::Subscription.find_by_id subscription.id
- assert_subscription_successfully_paid subscription, 2000
+ assert_subscription_successfully_paid found_subscription, 2000
end
should 'be able to create subscription without plan and charge with installments' do
subscription = PagarMe::Subscription.create subscription_with_customer_with_card_params(amount: 2000, installments: 6)
assert_subscription_successfully_paid subscription, 2000, 6
@@ -51,10 +51,10 @@
subscription.charge 1500, 3
assert_equal id, subscription.id
assert_subscription_successfully_paid subscription, 1500, 3
found_subscription = PagarMe::Subscription.find_by_id subscription.id
- assert_subscription_successfully_paid subscription, 1500, 3
+ assert_subscription_successfully_paid found_subscription, 1500, 3
end
should 'be able to update subscription' do
subscription = PagarMe::Subscription.create subscription_with_customer_with_card_params