Test where filter handling numeric property values (#7821)
Merge pull request 7821
This commit is contained in:
parent
4eb7a408e4
commit
5cc78db648
|
@ -863,6 +863,17 @@ class TestFilters < JekyllUnitTest
|
||||||
assert_equal 2, @filter.where(array, "color", nil).length
|
assert_equal 2, @filter.where(array, "color", nil).length
|
||||||
end
|
end
|
||||||
|
|
||||||
|
should "filter objects with numerical properties appropriately" do
|
||||||
|
array = [
|
||||||
|
{ "value" => "555" },
|
||||||
|
{ "value" => 555 },
|
||||||
|
{ "value" => 24.625 },
|
||||||
|
{ "value" => "24.625" },
|
||||||
|
]
|
||||||
|
assert_equal 2, @filter.where(array, "value", 24.625).length
|
||||||
|
assert_equal 2, @filter.where(array, "value", 555).length
|
||||||
|
end
|
||||||
|
|
||||||
should "filter array properties appropriately" do
|
should "filter array properties appropriately" do
|
||||||
hash = {
|
hash = {
|
||||||
"a" => { "tags"=>%w(x y) },
|
"a" => { "tags"=>%w(x y) },
|
||||||
|
|
Loading…
Reference in New Issue