Sha256: da8522ae6ccc08ad2da5e69cf2e29863df34e998fa00c4d1df34724f3309c6db
Contents?: true
Size: 851 Bytes
Versions: 1
Compression:
Stored size: 851 Bytes
Contents
# encoding: utf-8 # require 'spec_helper' describe 'Multi Index Qualifiers' do it 'resolves the same qualifier to different categories on each index' do people = Picky::Index.new :people do category :title category :name, qualifiers: [:name, :last_name] end books = Picky::Index.new :books do category :title, qualifiers: [:title, :name] category :subtitle end person = Struct.new :id, :title, :name book = Struct.new :id, :title, :subtitle people.add person.new(1, 'mister', 'pedro maria alhambra madrugada') books.add book.new(2, 'the mister madrugada affair', 'the story of seventeen madrugada family members') try = Picky::Search.new people, books try.search('title:mister').ids.should == [1, 2] try.search('name:madrugada').ids.should == [1, 2] end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
picky-4.11.0 | spec/functional/multi_index_qualifier_spec.rb |