added specs: mongoid search by id

This commit is contained in:
Zhomart Mukhamejanov 2014-11-02 11:20:08 -08:00
parent 378c7d59dd
commit 7088c9e537
1 changed files with 6 additions and 0 deletions

View File

@ -198,6 +198,12 @@ module Ransack
s = Person.search(:only_admin_eq => 'htimS cirA')
expect(s.result.selector).to eq({})
end
it 'searches by id' do
ids = ['some_bson_id', 'another_bson_id']
s = Person.search(:id_in => ids)
expect(s.result.selector).to eq({ '_id' => { '$in' => ids } })
end
end
describe '#ransackable_attributes' do