Skip to content

Commit

Permalink
Test that builtin_directories is only used in development mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Carl Lerche committed Jun 30, 2009
1 parent 575b95e commit f281745
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions railties/test/initializer/path_test.rb
Expand Up @@ -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
Expand Down Expand Up @@ -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.