Sha256: 77ae4964f06f24d82b9ef7a0ccc64b4df0fe2a4c2f7432410378096a220bfc1d
Contents?: true
Size: 789 Bytes
Versions: 21
Compression:
Stored size: 789 Bytes
Contents
require 'test_helper' class DiscoApp::SubscriptionServiceTest < ActiveSupport::TestCase def setup @shop = disco_app_shops(:widget_store) @current_subscription = @shop.current_subscription end def teardown @shop = nil end test 'subscribing to a new plan deactivates current subscription and swaps to new plan' do DiscoApp::SubscriptionService.subscribe(@shop, disco_app_plans(:premium)) @current_subscription.reload assert @current_subscription.replaced? assert_equal disco_app_plans(:premium), @shop.current_subscription.plan end test 'cancelling a plan works' do DiscoApp::SubscriptionService.cancel(@shop) @current_subscription.reload assert @current_subscription.cancelled? assert_not @shop.current_subscription end end
Version data entries
21 entries across 21 versions & 1 rubygems