Sha256: 6f9b9959eac92554eb8da3f52f746271231d727d9e1e30cdd8b77729a6f754b3

Contents?: true

Size: 568 Bytes

Versions: 1

Compression:

Stored size: 568 Bytes

Contents

require 'spec_helper'

describe ApiClient::Collection do
  let(:user) { User.new }

  before :each do
    stub_request(:get, 'http://api.example.com/users').to_return(:body => [ { 'a' => 'b' }, { 'a' => 'b2' } ].to_json)
    User.stub(:new => user)
    @collection = ApiClient::Collection.new(User, :default, 'users')
  end

  it 'should include enumerable module' do
    @collection.should respond_to(:first)
  end

  describe '.initialize' do
    it 'Should initialize a collection of Objects' do
      @collection.collection.should == [user, user]
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
api-client-2.4.0 spec/api-client/collection_spec.rb