From f281745056cd67c967c5a695694061f515385be8 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Tue, 30 Jun 2009 13:53:03 -0700 Subject: Test that builtin_directories is only used in development mode --- railties/test/initializer/path_test.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'railties') diff --git a/railties/test/initializer/path_test.rb b/railties/test/initializer/path_test.rb index 37e1eebbc7..8fbad24a73 100644 --- a/railties/test/initializer/path_test.rb +++ b/railties/test/initializer/path_test.rb @@ -14,6 +14,8 @@ Rails::Initializer.run do |config| end class PathsTest < ActiveSupport::TestCase + include ActiveSupport::Testing::Isolation + def setup @paths = Rails::Initializer.default.config.paths end @@ -83,4 +85,19 @@ class PathsTest < ActiveSupport::TestCase assert_not_in_load_path "tmp", "cache" end + test "controller paths include builtin in development mode" do + RAILS_ENV.replace "development" + assert Rails::Configuration.new.paths.app.controllers.paths.any? { |p| p =~ /builtin/ } + end + + test "controller paths does not have builtin_directories in test mode" do + RAILS_ENV.replace "test" + assert !Rails::Configuration.new.paths.app.controllers.paths.any? { |p| p =~ /builtin/ } + end + + test "controller paths does not have builtin_directories in production mode" do + RAILS_ENV.replace "production" + assert !Rails::Configuration.new.paths.app.controllers.paths.any? { |p| p =~ /builtin/ } + end + end \ No newline at end of file -- cgit v1.2.3