aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2012-01-04 08:08:19 -0800
committerSantiago Pastorino <santiago@wyeworks.com>2012-01-04 08:08:19 -0800
commite2e4216d645ce32ad11b2a681b45c85025de3d1d (patch)
tree7ad54e9c2025222100635d20aa55e220a94ca9e6 /activesupport/test
parent40cf1269074a181a23f362a910dfaf2a02f7e562 (diff)
parent38b9fbf1d98febed449a152b2098deccea48603a (diff)
downloadrails-e2e4216d645ce32ad11b2a681b45c85025de3d1d.tar.gz
rails-e2e4216d645ce32ad11b2a681b45c85025de3d1d.tar.bz2
rails-e2e4216d645ce32ad11b2a681b45c85025de3d1d.zip
Merge pull request #4289 from rafaelfranca/patch-1
No need of html_safe here
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/safe_buffer_test.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/activesupport/test/safe_buffer_test.rb b/activesupport/test/safe_buffer_test.rb
index 8f77999d25..8d9911ea01 100644
--- a/activesupport/test/safe_buffer_test.rb
+++ b/activesupport/test/safe_buffer_test.rb
@@ -96,13 +96,20 @@ 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
@buffer.safe_concat "BUSTED"
end
end
-
+
test "should not fail if the returned object is not a string" do
assert_kind_of NilClass, @buffer.slice("chipchop")
end