Skip to content
Browse files

Added test to verify the filter exclude behaviour (should have included

with the previous commit oops...).
  • Loading branch information...
1 parent 7a09a3f commit fe8ba1fcc98e7ca195ad5529f74aee879af7f221 @smulube smulube committed with Evan
Showing with 12 additions and 1 deletion.
  1. +12 −1 test/integration/search_test.rb
View
13 test/integration/search_test.rb
@@ -198,6 +198,17 @@ def test_text_filter
S.new(:class_names => 'Seller', :filters => {'company_name' => 'seller17'}).run.size
)
end
+
+ def test_exclusion_filter
+ assert_equal(
+ Seller.count(:conditions => 'user_id = 17'),
+ S.new(:class_names => 'Seller', :filters => { 'user_id' => { 'value' => 17, 'exclude' => false } }).run.size
+ )
+ assert_equal(
+ Seller.count(:conditions => 'user_id != 17'),
+ S.new(:class_names => 'Seller', :filters => { 'user_id' => { 'value' => 17, 'exclude' => true } }).run.size
+ )
+ end
def test_invalid_filter
assert_raises(Ultrasphinx::UsageError) do
@@ -378,4 +389,4 @@ def test_distance_decending
assert_match /Kailua Beach Park/, @s.first.name
assert_in_delta 16940, @s.first.distance, 40
end
-end
+end

0 comments on commit fe8ba1f

Please sign in to comment.
Something went wrong with that request. Please try again.