Sha256: b42421883e4a3af92cfeb531c218725743cb4f356774a81db0fdef5c89a8864d

Contents?: true

Size: 417 Bytes

Versions: 3

Compression:

Stored size: 417 Bytes

Contents

require 'spec_helper'

RSpec.describe RecordCollection::Base do

  describe '#ids' do
    it 'returns the ids of the collection' do
      employee = Employee.create name: 'E1', section: 'ABC', admin: true, vegan: false
      described_class.new([employee]).ids.should eq [employee.id]
    end

    it 'returns an empty array for an empty collection' do
      described_class.new.ids.should be_empty
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
record_collection-0.5.2 spec/base/accessors_spec.rb
record_collection-0.5.1 spec/base/accessors_spec.rb
record_collection-0.5.0 spec/base/accessors_spec.rb