diff options
author | Carl Lerche <carllerche@mac.com> | 2009-06-30 13:53:03 -0700 |
---|---|---|
committer | Carl Lerche <carllerche@mac.com> | 2009-06-30 13:53:03 -0700 |
commit | f281745056cd67c967c5a695694061f515385be8 (patch) | |
tree | e0b1ef708578f9a2ac0954848798b813e17c3a77 | |
parent | 575b95ea0bf3d3fff6f47dddad23c754fb294604 (diff) | |
download | rails-f281745056cd67c967c5a695694061f515385be8.tar.gz rails-f281745056cd67c967c5a695694061f515385be8.tar.bz2 rails-f281745056cd67c967c5a695694061f515385be8.zip |
Test that builtin_directories is only used in development mode
-rw-r--r-- | railties/test/initializer/path_test.rb | 17 |
1 files changed, 17 insertions, 0 deletions
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 |