where filter - test return value when filtering a Hash

This commit is contained in:
Mike Kruk 2014-10-08 17:02:36 -04:00
parent f6ea8b4d50
commit 56ac50c568
1 changed files with 3 additions and 1 deletions

View File

@ -176,7 +176,9 @@ class TestFilters < Test::Unit::TestCase
end
should "filter objects in a hash appropriately" do
assert_equal 1, @filter.where({"a"=>{"color"=>"red"}, "b"=>{"color"=>"blue"}}, "color", "red").length
hash = {"a"=>{"color"=>"red"}, "b"=>{"color"=>"blue"}}
assert_equal 1, @filter.where(hash, "color", "red").length
assert_equal [{"color"=>"red"}], @filter.where(hash, "color", "red")
end
should "filter objects appropriately" do