spec/functional/facets_spec.rb in picky-4.6.0 vs spec/functional/facets_spec.rb in picky-4.6.1
- old
+ new
@@ -56,16 +56,25 @@
'schiess' => 1
}
# It has two facets.
#
- # TODO Rewrite API.
- #
finder.facets(:name, filter: 'surname:hanke').should == {
'fritz' => 1,
'florian' => 1
}
+
+ # It only uses exact matches (ie. the last token is not partialized).
+ #
+ finder.facets(:name, filter: 'surname:hank').should == {}
+
+ # It allows explicit partial matches.
+ #
+ finder.facets(:name, filter: 'surname:hank*').should == {
+ 'fritz' => 1,
+ 'florian' => 1
+ }
end
end
end
describe 'complex example' do
@@ -136,11 +145,11 @@
finder.facets(:surname, filter: 'age_category:40 name:peter').should == {
'kunz' => 1,
'hanke' => 1 # Not 2 since it is filtered.
}
end
- it 'has 2 facets >= count 0' do
+ it 'has 2 facets >= count 1' do
finder.facets(:surname, filter: 'age_category:40 name:peter', at_least: 1).should == {
'kunz' => 1,
'hanke' => 1
}
end
@@ -164,10 +173,10 @@
finder.facets(:surname, filter: 'age_category:40 name:peter', counts: false).should == [
'kunz',
'hanke'
]
end
- it 'has 2 facets >= count 0' do
+ it 'has 2 facets >= count 1' do
finder.facets(:surname, filter: 'age_category:40 name:peter', at_least: 1, counts: false).should == [
'kunz',
'hanke'
]
end