diff options
author | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-04-30 15:13:40 -0700 |
---|---|---|
committer | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-05-01 17:31:02 -0700 |
commit | 4ee3e5b094463383891789f484e927b19fccc744 (patch) | |
tree | 4595acf5dc068ebad2f796992d12659d65460337 /actionpack/test/new_base | |
parent | d58b57a3caf4ad434c2be4f63eecd9a1921c7c4a (diff) | |
download | rails-4ee3e5b094463383891789f484e927b19fccc744.tar.gz rails-4ee3e5b094463383891789f484e927b19fccc744.tar.bz2 rails-4ee3e5b094463383891789f484e927b19fccc744.zip |
Ported over the concept of public instance methods on controller child classes as callable action methods
Diffstat (limited to 'actionpack/test/new_base')
-rw-r--r-- | actionpack/test/new_base/render_test.rb | 10 | ||||
-rw-r--r-- | actionpack/test/new_base/test_helper.rb | 10 |
2 files changed, 15 insertions, 5 deletions
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 |