Sha256: dafad309868ea4d310d1b51724071b5ec07cc02ed6a44f9eef1cbff70c1cf562

Contents?: true

Size: 1.42 KB

Versions: 16

Compression:

Stored size: 1.42 KB

Contents

require File.expand_path('../../test_helper', __FILE__)

module Paid
  class AccountTest < Test::Unit::TestCase
    setup do
      @account_url = "#{Paid.api_base}/account"
    end

    should 'be retrievable' do
      @mock.expects(:get).once.with(@account_url, anything, anything).returns(test_response(test_account))
      a = Paid::Account.retrieve
      assert(a.is_a?(Paid::Account))
      assert_equal(test_account[:id], a.id)
    end

    context 'Retrieved Paid::Account instance' do
      setup do
        @mock.expects(:get).once.returns(test_response(test_account))
        @account = Paid::Account.retrieve
      end

      should 'have the id attribute' do
        assert_equal(test_account[:id], @account.id)
      end

      should 'have the object attribute' do
        assert_equal(test_account[:object], @account.object)
      end

      should 'have the business_name attribute' do
        assert_equal(test_account[:business_name], @account.business_name)
      end

      should 'have the business_url attribute' do
        assert_equal(test_account[:business_url], @account.business_url)
      end

      should 'have the business_logo attribute' do
        assert_equal(test_account[:business_logo], @account.business_logo)
      end
    end

    should 'be registered' do
      assert(APIResource.api_subclasses.include?(Paid::Account))
      assert_equal(Paid::Account, APIResource.api_subclass_fetch("account"))
    end

  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
paid-1.2.1 test/paid/account_test.rb
paid-1.2.0 test/paid/account_test.rb
paid-1.1.4 test/paid/account_test.rb
paid-1.1.3 test/paid/account_test.rb
paid-1.1.2 test/paid/account_test.rb
paid-1.1.1 test/paid/account_test.rb
paid-1.1.0 test/paid/account_test.rb
paid-1.0.11 test/paid/account_test.rb
paid-1.0.10 test/paid/account_test.rb
paid-1.0.9 test/paid/account_test.rb
paid-1.0.8 test/paid/account_test.rb
paid-1.0.7 test/paid/account_test.rb
paid-1.0.6 test/paid/account_test.rb
paid-1.0.5 test/paid/account_test.rb
paid-1.0.3 test/paid/account_test.rb
paid-1.0.2 test/paid/account_test.rb