spec/functional/realtime_spec.rb in picky-4.12.10 vs spec/functional/realtime_spec.rb in picky-4.12.11
- old
+ new
@@ -472,11 +472,11 @@
books.search('author:Athr~').ids.should == [:two, :one, :three]
end
end
end
- context 'special index' do
+ context 'with Redis backend' do
let(:index) do
Picky::Index.new(:books) do
backend Picky::Backends::Redis.new(realtime: true)
key_format :to_s # TODO Make key format dependent on backend?
category :title
@@ -490,9 +490,23 @@
end
context 'single category updating' do
it 'finds the first entry' do
books.search('title:Titl').ids.should == ['one']
+ end
+
+ it 'finds the first entry' do
+ books.search('author:author title:Titl').ids.should == ['one']
+ end
+
+ it 'finds the first entry' do
+ books.search('Author Titl').ids.should == ['one']
+ end
+
+ it 'finds the first entry the second time, too' do
+ books.search('author:author title:Titl')
+
+ books.search('author:author title:Titl').ids.should == ['one']
end
it 'allows removing a single category and leaving the others alone' do
index[:title].remove 'one'
\ No newline at end of file