Test where filter handling numeric property values (#7821)

Merge pull request 7821
This commit is contained in:
Ashwin Maroli 2020-02-04 10:54:40 +05:30 committed by GitHub
parent 4eb7a408e4
commit 5cc78db648
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 0 deletions

View File

@ -863,6 +863,17 @@ class TestFilters < JekyllUnitTest
assert_equal 2, @filter.where(array, "color", nil).length
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
hash = {
"a" => { "tags"=>%w(x y) },