diff options
author | David Chelimsky <dchelimsky@gmail.com> | 2010-04-17 14:52:37 -0500 |
---|---|---|
committer | wycats <wycats@gmail.com> | 2010-04-17 15:59:10 -0400 |
commit | 4327ad51abfddde822766702d154df11bd5b47a3 (patch) | |
tree | 387edf55bcc5241e02f2764d14691e3b285f1d1c /actionpack/test/controller/test_test.rb | |
parent | d4d352bf94f8d2b6fc5684706ed2b33da77203fd (diff) | |
download | rails-4327ad51abfddde822766702d154df11bd5b47a3.tar.gz rails-4327ad51abfddde822766702d154df11bd5b47a3.tar.bz2 rails-4327ad51abfddde822766702d154df11bd5b47a3.zip |
access assigns as a method or hash, with strings or symbols [#4431 state:resolved]
Diffstat (limited to 'actionpack/test/controller/test_test.rb')
-rw-r--r-- | actionpack/test/controller/test_test.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/actionpack/test/controller/test_test.rb b/actionpack/test/controller/test_test.rb index 6f1ce2fef7..f9fc7a0976 100644 --- a/actionpack/test/controller/test_test.rb +++ b/actionpack/test/controller/test_test.rb @@ -113,6 +113,11 @@ XML render :nothing => true end + def test_assigns + @foo = "foo" + render :nothing => true + end + private def rescue_action(e) raise e @@ -230,6 +235,17 @@ XML assert_equal "OK", @response.body end + def test_assigns + process :test_assigns + # assigns can be accessed using assigns(key) + # or assigns[key], where key is a string or + # a symbol + assert_equal "foo", assigns(:foo) + assert_equal "foo", assigns("foo") + assert_equal "foo", assigns[:foo] + assert_equal "foo", assigns["foo"] + end + def test_assert_tag_tag process :test_html_output |