diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-10-03 21:05:51 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-10-03 21:05:51 -0500 |
commit | 018b79dd36d054d87fdc408d38dc9ac7f1b1500d (patch) | |
tree | a954ecef58682b2d259432a04ce503f8bb865840 /actionpack/test/new_base/render_test.rb | |
parent | 84e94551f62d3bcbc71f1c6f3fda738342d984e2 (diff) | |
download | rails-018b79dd36d054d87fdc408d38dc9ac7f1b1500d.tar.gz rails-018b79dd36d054d87fdc408d38dc9ac7f1b1500d.tar.bz2 rails-018b79dd36d054d87fdc408d38dc9ac7f1b1500d.zip |
File extra test folders into controller, dispatch, or template
Diffstat (limited to 'actionpack/test/new_base/render_test.rb')
-rw-r--r-- | actionpack/test/new_base/render_test.rb | 85 |
1 files changed, 0 insertions, 85 deletions
diff --git a/actionpack/test/new_base/render_test.rb b/actionpack/test/new_base/render_test.rb deleted file mode 100644 index 804be79d17..0000000000 --- a/actionpack/test/new_base/render_test.rb +++ /dev/null @@ -1,85 +0,0 @@ -require 'abstract_unit' - -module Render - class BlankRenderController < ActionController::Base - self.view_paths = [ActionView::FixtureResolver.new( - "render/blank_render/index.html.erb" => "Hello world!", - "render/blank_render/access_request.html.erb" => "The request: <%= request.method.to_s.upcase %>", - "render/blank_render/access_action_name.html.erb" => "Action Name: <%= action_name %>", - "render/blank_render/access_controller_name.html.erb" => "Controller Name: <%= controller_name %>" - )] - - def index - render - end - - def access_request - render :action => "access_request" - end - - def render_action_name - render :action => "access_action_name" - end - - private - - def secretz - render :text => "FAIL WHALE!" - end - end - - class DoubleRenderController < ActionController::Base - def index - render :text => "hello" - render :text => "world" - end - end - - class RenderTest < SimpleRouteCase - test "render with blank" do - get "/render/blank_render" - - assert_body "Hello world!" - assert_status 200 - end - - test "rendering more than once raises an exception" do - assert_raises(AbstractController::DoubleRenderError) do - get "/render/double_render", {}, "action_dispatch.show_exceptions" => false - end - end - end - - class TestOnlyRenderPublicActions < SimpleRouteCase - describe "Only public methods on actual controllers are callable actions" - - test "raises an exception when a method of Object is called" do - assert_raises(AbstractController::ActionNotFound) do - get "/render/blank_render/clone", {}, "action_dispatch.show_exceptions" => false - end - end - - test "raises an exception when a private method is called" do - assert_raises(AbstractController::ActionNotFound) do - get "/render/blank_render/secretz", {}, "action_dispatch.show_exceptions" => false - end - end - end - - class TestVariousObjectsAvailableInView < SimpleRouteCase - test "The request object is accessible in the view" do - get "/render/blank_render/access_request" - assert_body "The request: GET" - end - - test "The action_name is accessible in the view" do - get "/render/blank_render/render_action_name" - assert_body "Action Name: render_action_name" - end - - test "The controller_name is accessible in the view" do - get "/render/blank_render/access_controller_name" - assert_body "Controller Name: blank_render" - end - end -end |