Sha256: 7bc195929c04eee56462aad9a8fc734b82586c9816a9ee4af2b05f0da75b093d

Contents?: true

Size: 559 Bytes

Versions: 16

Compression:

Stored size: 559 Bytes

Contents

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

module Paid
  class APIListTest < ::Test::Unit::TestCase

    context '#new / #initialize' do
      setup do
        @fake_resource = {:data => "fake-data"}
        @list = APIList.new(APIResource, [@fake_resource])
      end

      should 'set the klass' do
        assert_equal(APIResource, @list.klass)
      end

      should 'convert the data to klass instances' do
        assert(@list.first.is_a?(APIResource))
        assert_equal(@fake_resource, @list.first.json)
      end
    end

  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

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