Methods
- T
Instance Public methods
Source: show
# File rails/actionpack/test/controller/routing_test.rb, line 1789 def test_normalize_unix_paths load_paths = %w(. config/../app/controllers config/../app//helpers script/../config/../vendor/rails/actionpack/lib vendor/rails/railties/builtin/rails_info app/models lib script/../config/../foo/bar/../../app/models) paths = ActionController::Routing.normalize_paths(load_paths) assert_equal %w(vendor/rails/railties/builtin/rails_info vendor/rails/actionpack/lib app/controllers app/helpers app/models lib .), paths end
Source: show
# File rails/actionpack/test/controller/routing_test.rb, line 1795 def test_normalize_windows_paths load_paths = %w(. config\\..\\app\\controllers config\\..\\app\\\\helpers script\\..\\config\\..\\vendor\\rails\\actionpack\\lib vendor\\rails\\railties\\builtin\\rails_info app\\models lib script\\..\\config\\..\\foo\\bar\\..\\..\\app\\models) paths = ActionController::Routing.normalize_paths(load_paths) assert_equal %w(vendor\\rails\\railties\\builtin\\rails_info vendor\\rails\\actionpack\\lib app\\controllers app\\helpers app\\models lib .), paths end
Source: show
# File rails/actionpack/test/controller/routing_test.rb, line 1735 def test_possible_controllers true_controller_paths = ActionController::Routing.controller_paths ActionController::Routing.use_controllers! nil silence_warnings do Object.send(:const_set, :RAILS_ROOT, File.dirname(__FILE__) + '/controller_fixtures') end ActionController::Routing.controller_paths = [ RAILS_ROOT, RAILS_ROOT + '/app/controllers', RAILS_ROOT + '/vendor/plugins/bad_plugin/lib' ] assert_equal ["admin/user", "plugin", "user"], ActionController::Routing.possible_controllers.sort ensure if true_controller_paths ActionController::Routing.controller_paths = true_controller_paths end ActionController::Routing.use_controllers! nil Object.send(:remove_const, :RAILS_ROOT) rescue nil end
Source: show
# File rails/actionpack/test/controller/routing_test.rb, line 1757 def test_possible_controllers_are_reset_on_each_load true_possible_controllers = ActionController::Routing.possible_controllers true_controller_paths = ActionController::Routing.controller_paths ActionController::Routing.use_controllers! nil root = File.dirname(__FILE__) + '/controller_fixtures' ActionController::Routing.controller_paths = [] assert_equal [], ActionController::Routing.possible_controllers ActionController::Routing::Routes.load! ActionController::Routing.controller_paths = [ root, root + '/app/controllers', root + '/vendor/plugins/bad_plugin/lib' ] assert_equal ["admin/user", "plugin", "user"], ActionController::Routing.possible_controllers.sort ensure ActionController::Routing.controller_paths = true_controller_paths ActionController::Routing.use_controllers! true_possible_controllers Object.send(:remove_const, :RAILS_ROOT) rescue nil ActionController::Routing::Routes.clear! ActionController::Routing::Routes.load_routes! end
Source: show
# File rails/actionpack/test/controller/routing_test.rb, line 1782 def test_with_controllers c = %w(admin/accounts admin/users account pages) ActionController::Routing.with_controllers c do assert_equal c, ActionController::Routing.possible_controllers end end