Permalink
Browse files

Test that builtin_directories is only used in development mode

  • Loading branch information...
1 parent 575b95e commit f281745056cd67c967c5a695694061f515385be8 Carl Lerche committed Jun 30, 2009
Showing with 17 additions and 0 deletions.
  1. +17 −0 railties/test/initializer/path_test.rb
@@ -14,6 +14,8 @@ def self.vendor_rails? ; false ; end
end
class PathsTest < ActiveSupport::TestCase
+ include ActiveSupport::Testing::Isolation
+
def setup
@paths = Rails::Initializer.default.config.paths
end
@@ -83,4 +85,19 @@ def assert_not_in_load_path(*path)
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

0 comments on commit f281745

Please sign in to comment.