Sha256: 171c6f77505f5b0bb7b157bc476aa21bcf7e3f8f61fa40817339db629b69263d

Contents?: true

Size: 565 Bytes

Versions: 6

Compression:

Stored size: 565 Bytes

Contents

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

module SynapsePay
  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

6 entries across 6 versions & 1 rubygems

Version Path
synapse_pay-0.0.8 test/synapse_pay/api_list_test.rb
synapse_pay-0.0.7 test/synapse_pay/api_list_test.rb
synapse_pay-0.0.6 test/synapse_pay/api_list_test.rb
synapse_pay-0.0.4 test/synapse_pay/api_list_test.rb
synapse_pay-0.0.3 test/synapse_pay/api_list_test.rb
synapse_pay-0.0.1 test/synapse_pay/api_list_test.rb