diff options
author | Yehuda Katz <wycats@gmail.com> | 2009-03-19 13:35:39 -0700 |
---|---|---|
committer | Yehuda Katz <wycats@gmail.com> | 2009-03-19 13:35:39 -0700 |
commit | 8ab37c76608d7105c47566e79b85fcf72cb11e4b (patch) | |
tree | 590cac61655bdb00d2df7015b515bc125e4c8b10 /actionpack/test/new_base/render_action_test.rb | |
parent | e0447023db7152d3ecdf693bd9aa36c7daa02653 (diff) | |
download | rails-8ab37c76608d7105c47566e79b85fcf72cb11e4b.tar.gz rails-8ab37c76608d7105c47566e79b85fcf72cb11e4b.tar.bz2 rails-8ab37c76608d7105c47566e79b85fcf72cb11e4b.zip |
Started implementing render :action
Diffstat (limited to 'actionpack/test/new_base/render_action_test.rb')
-rw-r--r-- | actionpack/test/new_base/render_action_test.rb | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/actionpack/test/new_base/render_action_test.rb b/actionpack/test/new_base/render_action_test.rb new file mode 100644 index 0000000000..b6e98f82aa --- /dev/null +++ b/actionpack/test/new_base/render_action_test.rb @@ -0,0 +1,75 @@ +require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper") + +module HappyPath + + class RenderActionController < ActionController::Base2 + + def render_action_hello_world + render :action => "hello_world" + end + + def render_action_hello_world_as_string + render "hello_world" + end + + def render_action_hello_world_as_string_with_options + render "hello_world", :status => 404 + end + + def render_action_hello_world_as_symbol + render :hello_world + end + + def render_action_hello_world_with_symbol + render :action => :hello_world + end + + end + + class TestRenderAction < SimpleRouteCase + + describe "Rendering an action using :action => <String>" + + get "/happy_path/render_action/render_action_hello_world" + assert_body "Hello world!" + assert_status 200 + + end + + class TestRenderActionWithString < SimpleRouteCase + + describe "Render an action using 'hello_world'" + + get "/happy_path/render_action/render_action_hello_world_as_string" + assert_body "Hello world!" + assert_status 200 + + end + + class TestRenderActionWithStringAndOptions < SimpleRouteCase + + describe "Render an action using 'hello_world'" + + get "/happy_path/render_action/render_action_hello_world_as_string_with_options" + assert_body "Hello world!" + assert_status 404 + + end + + class TestRenderActionAsSymbol < SimpleRouteCase + describe "Render an action using :hello_world" + + get "/happy_path/render_action/render_action_hello_world_as_symbol" + assert_body "Hello world!" + assert_status 200 + end + + class TestRenderActionWithSymbol < SimpleRouteCase + describe "Render an action using :action => :hello_world" + + get "/happy_path/render_action/render_action_hello_world_with_symbol" + assert_body "Hello world!" + assert_status 200 + end + +end
\ No newline at end of file |