Sha256: d4201a6f731d108b8b86c6827402ab671931932b82586e02789e0e64c9cf39e6

Contents?: true

Size: 644 Bytes

Versions: 17

Compression:

Stored size: 644 Bytes

Contents

require 'spec_helper'

describe ActionKitRest::Response::Collection  do
  let(:meta) { double() }
  let(:objects) { double() }
  subject { ActionKitRest::Response::Collection.new(meta, objects) }

  describe 'initialization' do
    it 'should set meta and objects' do
      subject.meta.should == meta
      subject.objects.should == objects
    end
  end

  describe 'each' do
    let(:item1) { double }
    let(:item2) { double }
    let(:objects) { [ item1, item2 ] }

    it "should return all collection items" do
      subject.count.should == 2
      subject.any? { |i| i == item1 }
      subject.any? { |i| i == item2 }
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
action_kit_rest-0.4.4 spec/lib/action_kit_rest/response/collection_spec.rb
action_kit_rest-0.4.3 spec/lib/action_kit_rest/response/collection_spec.rb
action_kit_rest-0.4.2 spec/lib/action_kit_rest/response/collection_spec.rb
action_kit_rest-0.4.1 spec/lib/action_kit_rest/response/collection_spec.rb
action_kit_rest-0.4.0 spec/lib/action_kit_rest/response/collection_spec.rb
action_kit_rest-0.3.8 spec/lib/action_kit_rest/response/collection_spec.rb
action_kit_rest-0.3.7 spec/lib/action_kit_rest/response/collection_spec.rb
action_kit_rest-0.3.6 spec/lib/action_kit_rest/response/collection_spec.rb
action_kit_rest-0.3.5 spec/lib/action_kit_rest/response/collection_spec.rb
action_kit_rest-0.3.4 spec/lib/action_kit_rest/response/collection_spec.rb
action_kit_rest-0.3.3 spec/lib/action_kit_rest/response/collection_spec.rb
action_kit_rest-0.3.2 spec/lib/action_kit_rest/response/collection_spec.rb
action_kit_rest-0.3.1 spec/lib/action_kit_rest/response/collection_spec.rb
action_kit_rest-0.3.0 spec/lib/action_kit_rest/response/collection_spec.rb
action_kit_rest-0.2.2 spec/action_kit_rest/response/collection_spec.rb
action_kit_rest-0.2.1 spec/action_kit_rest/response/collection_spec.rb
action_kit_rest-0.2.0 spec/action_kit_rest/response/collection_spec.rb