aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorRafael Mendonça França <rafael.franca@plataformatec.com.br>2012-01-04 12:37:20 -0300
committerRafael Mendonça França <rafael.franca@plataformatec.com.br>2012-01-04 12:37:20 -0300
commit73a0f9df475159bf7f5f4df60d5b8f2694407d8b (patch)
tree6c2c136995c1a611b2aa6609792776e1611f948d /activesupport/test
parent63f48b113a31c8ef523293ff6d9bc8c5c2261aef (diff)
downloadrails-73a0f9df475159bf7f5f4df60d5b8f2694407d8b.tar.gz
rails-73a0f9df475159bf7f5f4df60d5b8f2694407d8b.tar.bz2
rails-73a0f9df475159bf7f5f4df60d5b8f2694407d8b.zip
Add test to make sure that add two safe buffers always return a safe buffer
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/safe_buffer_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/activesupport/test/safe_buffer_test.rb b/activesupport/test/safe_buffer_test.rb
index 8f77999d25..c7a4c9f7e8 100644
--- a/activesupport/test/safe_buffer_test.rb
+++ b/activesupport/test/safe_buffer_test.rb
@@ -96,6 +96,13 @@ class SafeBufferTest < ActiveSupport::TestCase
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