diff --git a/test/integration/context_test.rb b/test/integration/context_test.rb index 83bb43e3..0f4255ab 100644 --- a/test/integration/context_test.rb +++ b/test/integration/context_test.rb @@ -20,4 +20,14 @@ class ContextTest < Test::Unit::TestCase assert_equal 'Global test', Template.parse("{{'test' | notice }}").render! assert_equal 'Local test', Template.parse("{{'test' | notice }}").render!({}, :filters => [local]) end + + def test_has_key_will_not_add_an_error_for_missing_keys + Template.error_mode = :strict + + context = Context.new + + context.has_key?('unknown') + + assert_empty context.errors + end end diff --git a/test/integration/tags/include_tag_test.rb b/test/integration/tags/include_tag_test.rb index b79cfd70..eca109f3 100644 --- a/test/integration/tags/include_tag_test.rb +++ b/test/integration/tags/include_tag_test.rb @@ -205,4 +205,12 @@ class IncludeTagTest < Test::Unit::TestCase Liquid::Template.tags['include'] = original_tag end end + + def test_does_not_add_error_in_strict_mode_for_missing_variable + Liquid::Template.file_system = TestFileSystem.new + + a = Liquid::Template.parse(' {% include "nested_template" %}') + a.render! + assert_empty a.errors + end end # IncludeTagTest