Merge pull request #584 from Shopify/replace-non-string

Convert arguments to replace filters to strings to avoid exceptions.
This commit is contained in:
Dylan Thacker-Smith
2015-06-02 16:41:15 -04:00
2 changed files with 4 additions and 2 deletions

View File

@@ -268,7 +268,9 @@ class StandardFiltersTest < Minitest::Test
def test_replace
assert_equal '2 2 2 2', @filters.replace('1 1 1 1', '1', 2)
assert_equal '2 2 2 2', @filters.replace('1 1 1 1', 1, 2)
assert_equal '2 1 1 1', @filters.replace_first('1 1 1 1', '1', 2)
assert_equal '2 1 1 1', @filters.replace_first('1 1 1 1', 1, 2)
assert_template_result '2 1 1 1', "{{ '1 1 1 1' | replace_first: '1', 2 }}"
end