Sha256: 03f5ea70137f403a10c245a3efe8d72fe1936904a5699ff6873e92634bcbc108

Contents?: true

Size: 908 Bytes

Versions: 2

Compression:

Stored size: 908 Bytes

Contents

# -*- coding: utf-8 -*-
require File.expand_path('../../test_helper', __FILE__)

module Peakium
  class SubscriptionTest < Test::Unit::TestCase
    should "subscriptions should be listable" do
      @mock.expects(:get).once.returns(test_response(test_subscription_array))
      s = Peakium::Subscription.all.data
      assert s.kind_of? Array
      assert s[0].kind_of? Peakium::Subscription
    end

    should "subscriptions should be deletable" do
      @mock.expects(:get).once.returns(test_response(test_customer))
      c = Peakium::Customer.retrieve("cu_test_customer")

      @mock.expects(:get).once.returns(test_response(test_subscription))
      s = c.subscription("test_subscription")

      @mock.expects(:delete).once.with("#{Peakium.api_base}/v1/customers/cu_test_customer/subscriptions/test_subscription", nil, nil).returns(test_response(test_subscription()))
      s.delete
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
peakium-0.1.4 test/peakium/subscription_test.rb
peakium-0.1.3 test/peakium/subscription_test.rb