Add test to make sure that add two safe buffers always return a safe buffer

上级 63f48b11
......@@ -96,6 +96,13 @@ def setup
assert !@buffer.dup.html_safe?
end
test "Should return safe buffer when added with another safe buffer" do
clean = "<script>".html_safe
result_buffer = @buffer + clean
assert result_buffer.html_safe?
assert_equal "<script>", result_buffer
end
test "Should raise an error when safe_concat is called on dirty buffers" do
@buffer.gsub!('', '<>')
assert_raise ActiveSupport::SafeBuffer::SafeConcatError do
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册