From f7fdbae770275ccbc277c42287b9783cb00fa9fa Mon Sep 17 00:00:00 2001 From: Ripta Pasay Date: Sat, 12 Jul 2008 18:54:24 -0400 Subject: Use fully-qualified controller name when logging. [#600 state:resolved] Signed-off-by: Pratik Naik --- actionpack/test/controller/base_test.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'actionpack/test') diff --git a/actionpack/test/controller/base_test.rb b/actionpack/test/controller/base_test.rb index 34c0200fe8..d49cc2a9aa 100644 --- a/actionpack/test/controller/base_test.rb +++ b/actionpack/test/controller/base_test.rb @@ -7,6 +7,7 @@ module Submodule end class ContainedNonEmptyController < ActionController::Base def public_action + render :nothing => true end hide_action :hidden_action @@ -105,6 +106,18 @@ end class PerformActionTest < Test::Unit::TestCase + class MockLogger + attr_reader :logged + + def initialize + @logged = [] + end + + def method_missing(method, *args) + @logged << args.first + end + end + def use_controller(controller_class) @controller = controller_class.new @@ -142,6 +155,13 @@ class PerformActionTest < Test::Unit::TestCase get :another_hidden_action assert_response 404 end + + def test_namespaced_action_should_log_module_name + use_controller Submodule::ContainedNonEmptyController + @controller.logger = MockLogger.new + get :public_action + assert_match /Processing\sSubmodule::ContainedNonEmptyController#public_action/, @controller.logger.logged[1] + end end class DefaultUrlOptionsTest < Test::Unit::TestCase -- cgit v1.2.3