Skip to content

Commit

Permalink
+ facets tests
Browse files Browse the repository at this point in the history
  • Loading branch information
floere committed Jul 28, 2012
1 parent 42921d8 commit 42339c3
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions server/spec/functional/facets_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,17 @@
'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
Expand Down Expand Up @@ -138,7 +149,7 @@
'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
Expand Down Expand Up @@ -166,7 +177,7 @@
'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'
Expand Down

0 comments on commit 42339c3

Please sign in to comment.