From 4ee3e5b094463383891789f484e927b19fccc744 Mon Sep 17 00:00:00 2001 From: Yehuda Katz + Carl Lerche Date: Thu, 30 Apr 2009 15:13:40 -0700 Subject: Ported over the concept of public instance methods on controller child classes as callable action methods --- actionpack/test/new_base/render_test.rb | 10 ++++++++++ actionpack/test/new_base/test_helper.rb | 10 +++++----- 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'actionpack/test/new_base') diff --git a/actionpack/test/new_base/render_test.rb b/actionpack/test/new_base/render_test.rb index 93bc8d854c..bc7203f294 100644 --- a/actionpack/test/new_base/render_test.rb +++ b/actionpack/test/new_base/render_test.rb @@ -35,4 +35,14 @@ module Render end end end + + class TestRenderObjectMethod < SimpleRouteCase + describe "Methods on Object are not actions" + + test "raises an exception" do + assert_raises(AbstractController::ActionNotFound) do + get "/render/blank_render/clone" + end + end + end end \ No newline at end of file diff --git a/actionpack/test/new_base/test_helper.rb b/actionpack/test/new_base/test_helper.rb index 03af5a66a6..d58b83cf7b 100644 --- a/actionpack/test/new_base/test_helper.rb +++ b/actionpack/test/new_base/test_helper.rb @@ -34,6 +34,8 @@ end module ActionController class Base2 < Http + abstract! + use AbstractController::Callbacks use AbstractController::Helpers use AbstractController::Logger @@ -80,15 +82,13 @@ module ActionController end def respond_to_action?(action_name) - super || view_paths.find_by_parts(action_name, {:formats => formats, :locales => [I18n.locale]}, controller_path) + super || view_paths.find_by_parts?(action_name.to_s, {:formats => formats, :locales => [I18n.locale]}, controller_path) end - - # append_view_path File.join(File.dirname(__FILE__), '..', 'fixtures') - - CORE_METHODS = self.public_instance_methods end class CompatibleBase2 < Base2 + abstract! + use ActionController::Rails2Compatibility end end -- cgit v1.2.3