Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test where filter handling numeric property values #7821

Merged
merged 3 commits into from Feb 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions test/test_filters.rb
Expand Up @@ -863,6 +863,17 @@ def to_liquid
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) },
Expand Down