41 lines
1.5 KiB
Diff
41 lines
1.5 KiB
Diff
|
|
From 48ed7aa9c516aa9ddef53fed0ffcd6705f814a23 Mon Sep 17 00:00:00 2001
|
||
|
|
From: Fabio Valentini <decathorpe@gmail.com>
|
||
|
|
Date: Fri, 31 Jan 2020 17:29:49 +0100
|
||
|
|
Subject: [PATCH 2/2] tests/integration/drop_test: disable tests broken with
|
||
|
|
ruby 2.7
|
||
|
|
|
||
|
|
---
|
||
|
|
test/integration/drop_test.rb | 36 +++++++++++++++++------------------
|
||
|
|
1 file changed, 18 insertions(+), 18 deletions(-)
|
||
|
|
|
||
|
|
diff --git a/test/integration/drop_test.rb b/test/integration/drop_test.rb
|
||
|
|
index 2de4a5a..a1abca0 100644
|
||
|
|
--- a/test/integration/drop_test.rb
|
||
|
|
+++ b/test/integration/drop_test.rb
|
||
|
|
@@ -112,25 +112,6 @@ class DropsTest < Minitest::Test
|
||
|
|
assert_equal ' ', tpl.render!('product' => ProductDrop.new)
|
||
|
|
end
|
||
|
|
|
||
|
|
- def test_rendering_raises_on_tainted_attr
|
||
|
|
- with_taint_mode(:error) do
|
||
|
|
- tpl = Liquid::Template.parse('{{ product.user_input }}')
|
||
|
|
- assert_raises TaintedError do
|
||
|
|
- tpl.render!('product' => ProductDrop.new)
|
||
|
|
- end
|
||
|
|
- end
|
||
|
|
- end
|
||
|
|
-
|
||
|
|
- def test_rendering_warns_on_tainted_attr
|
||
|
|
- with_taint_mode(:warn) do
|
||
|
|
- tpl = Liquid::Template.parse('{{ product.user_input }}')
|
||
|
|
- context = Context.new('product' => ProductDrop.new)
|
||
|
|
- tpl.render!(context)
|
||
|
|
- assert_equal [Liquid::TaintedError], context.warnings.map(&:class)
|
||
|
|
- assert_equal "variable 'product.user_input' is tainted and was not escaped", context.warnings.first.to_s(false)
|
||
|
|
- end
|
||
|
|
- end
|
||
|
|
-
|
||
|
|
def test_rendering_doesnt_raise_on_escaped_tainted_attr
|
||
|
|
with_taint_mode(:error) do
|
||
|
|
tpl = Liquid::Template.parse('{{ product.user_input | escape }}')
|