Ensure truncate is operating on a string

This commit is contained in:
Jonathan Cheatham
2015-12-22 19:33:34 -08:00
parent 5f8086572b
commit b892a73463
2 changed files with 6 additions and 1 deletions

View File

@@ -262,6 +262,10 @@ class StandardFiltersTest < Minitest::Test
assert_template_result 'foobar', '{{ foo | last }}', 'foo' => [ThingWithToLiquid.new]
end
def test_truncate_calls_to_liquid
assert_template_result "wo...", '{{ foo | truncate: 5 }}', "foo" => TestThing.new
end
def test_date
assert_equal 'May', @filters.date(Time.parse("2006-05-05 10:00:00"), "%B")
assert_equal 'June', @filters.date(Time.parse("2006-06-05 10:00:00"), "%B")