Permalink
Browse files

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

…buffer
  • Loading branch information...
1 parent 63f48b1 commit 73a0f9df475159bf7f5f4df60d5b8f2694407d8b Rafael Mendonça França committed Jan 4, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 activesupport/test/safe_buffer_test.rb
@@ -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

0 comments on commit 73a0f9d

Please sign in to comment.