aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorAlan Harper <alan@aussiegeek.net>2010-04-19 12:48:35 +1000
committerJosé Valim <jose.valim@gmail.com>2010-06-10 20:04:37 +0200
commit566967eaf3a66ff6a7e31f43894e21a1940ba9e7 (patch)
tree511306a9c65a05fe503883cdfaef8233948393b3 /actionpack
parent51590ad1756183f84a3df4790d0b07bcf1e74ed4 (diff)
downloadrails-566967eaf3a66ff6a7e31f43894e21a1940ba9e7.tar.gz
rails-566967eaf3a66ff6a7e31f43894e21a1940ba9e7.tar.bz2
rails-566967eaf3a66ff6a7e31f43894e21a1940ba9e7.zip
Missing method error doesn't specify which controller it is missing from [#4436 state:resolved]
The error page shown when the method you are requesting on a controller doesn't specify which controller the method is missing from Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/abstract_controller/base.rb2
-rw-r--r--actionpack/test/controller/base_test.rb11
2 files changed, 11 insertions, 2 deletions
diff --git a/actionpack/lib/abstract_controller/base.rb b/actionpack/lib/abstract_controller/base.rb
index ff97a7e76a..e1027840ef 100644
--- a/actionpack/lib/abstract_controller/base.rb
+++ b/actionpack/lib/abstract_controller/base.rb
@@ -106,7 +106,7 @@ module AbstractController
@_action_name = action_name = action.to_s
unless action_name = method_for_action(action_name)
- raise ActionNotFound, "The action '#{action}' could not be found"
+ raise ActionNotFound, "The action '#{action}' could not be found for #{self.class.name}"
end
@_response_body = nil
diff --git a/actionpack/test/controller/base_test.rb b/actionpack/test/controller/base_test.rb
index 49f79681f6..4f58b5d968 100644
--- a/actionpack/test/controller/base_test.rb
+++ b/actionpack/test/controller/base_test.rb
@@ -90,6 +90,7 @@ class RecordIdentifierController < ActionController::Base
end
class ControllerClassTests < ActiveSupport::TestCase
+
def test_controller_path
assert_equal 'empty', EmptyController.controller_path
assert_equal EmptyController.controller_path, EmptyController.new.controller_path
@@ -166,7 +167,15 @@ class PerformActionTest < ActionController::TestCase
rescue_action_in_public!
end
-
+
+ def test_process_should_be_precise
+ use_controller EmptyController
+ exception = assert_raise AbstractController::ActionNotFound do
+ get :non_existent
+ end
+ assert_equal exception.message, "The action 'non_existent' could not be found for EmptyController"
+ end
+
def test_get_on_priv_should_show_selector
use_controller MethodMissingController
get :shouldnt_be_called