Ensure sum filter calls to_liquid

This commit is contained in:
Adam Klingbaum
2023-06-22 16:25:11 +00:00
parent 77293d4524
commit 98ce25cb40
2 changed files with 26 additions and 11 deletions
+12
View File
@@ -982,6 +982,18 @@ class StandardFiltersTest < Minitest::Test
end
end
def test_sum_without_property_calls_to_liquid
t = TestThing.new
Liquid::Template.parse('{{ foo | sum }}').render("foo" => [t])
assert(t.foo > 0)
end
def test_sum_with_property_calls_to_liquid_on_property_values
t = TestThing.new
Liquid::Template.parse('{{ foo | sum: "quantity" }}').render("foo" => [{ "quantity" => t }])
assert(t.foo > 0)
end
private
def with_timezone(tz)