Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…buffer
  • Loading branch information...
commit 73a0f9df475159bf7f5f4df60d5b8f2694407d8b 1 parent 63f48b1
@rafaelfranca rafaelfranca authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 activesupport/test/safe_buffer_test.rb
View
7 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
Please sign in to comment.
Something went wrong with that request. Please try again.