提交 474e313d 编写于 作者: P Philipp Kempgen 提交者: root

test "Escapes special HTML/XML characters" do ...

上级 328a16b3
......@@ -381,6 +381,18 @@ def to_s
assert !@other_combination.html_safe?
end
test "Escapes special HTML/XML characters" do
@other_string = "other".html_safe
@combination = @other_string + "<foo>&\"'"
@other_combination = @string + "<foo>&\"'"
assert_equal "other&lt;foo&gt;&amp;&quot;&apos;", @combination
assert_equal "hello<foo>&\"'", @other_combination
assert @combination.html_safe?
assert !@other_combination.html_safe?
end
test "Concatting safe onto unsafe yields unsafe" do
@other_string = "other"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册