aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/raw_output_helper_test.rb
diff options
context:
space:
mode:
authorEmilio Tagua <miloops@gmail.com>2009-10-08 15:05:18 -0300
committerEmilio Tagua <miloops@gmail.com>2009-10-08 15:05:18 -0300
commit0cf4662ec589813c4fdc22de3398730cab05c5ed (patch)
treed422b8d8e4ccccf9bd89443b82398e1d7313269f /actionpack/test/template/raw_output_helper_test.rb
parentc3f9d51a00b9e7e5f5d14e7464fae04c48198756 (diff)
parent665c7ad29d5614b8f5535d317f1dd2803ddcaa7d (diff)
downloadrails-0cf4662ec589813c4fdc22de3398730cab05c5ed.tar.gz
rails-0cf4662ec589813c4fdc22de3398730cab05c5ed.tar.bz2
rails-0cf4662ec589813c4fdc22de3398730cab05c5ed.zip
Merge commit 'rails/master'
Diffstat (limited to 'actionpack/test/template/raw_output_helper_test.rb')
-rw-r--r--actionpack/test/template/raw_output_helper_test.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/actionpack/test/template/raw_output_helper_test.rb b/actionpack/test/template/raw_output_helper_test.rb
new file mode 100644
index 0000000000..598aa5b1d8
--- /dev/null
+++ b/actionpack/test/template/raw_output_helper_test.rb
@@ -0,0 +1,21 @@
+require 'abstract_unit'
+require 'testing_sandbox'
+
+class RawOutputHelperTest < ActionView::TestCase
+ tests ActionView::Helpers::RawOutputHelper
+ include TestingSandbox
+
+ def setup
+ @string = "hello"
+ end
+
+ test "raw returns the safe string" do
+ result = raw(@string)
+ assert_equal @string, result
+ assert result.html_safe?
+ end
+
+ test "raw handles nil values correctly" do
+ assert_equal "", raw(nil)
+ end
+end \ No newline at end of file