where filter - test return value when filtering a Hash
This commit is contained in:
parent
f6ea8b4d50
commit
56ac50c568
|
@ -176,7 +176,9 @@ class TestFilters < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
should "filter objects in a hash appropriately" do
|
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
|
end
|
||||||
|
|
||||||
should "filter objects appropriately" do
|
should "filter objects appropriately" do
|
||||||
|
|
Loading…
Reference in New Issue