Ensure asset_path defaults to nil for application

This commit is contained in:
José Valim 2010-12-09 21:18:41 +01:00
parent d1387a9942
commit 1860d873f2
3 changed files with 15 additions and 1 deletions

@ -138,6 +138,10 @@ def config
protected
def default_asset_path
nil
end
def default_middleware_stack
ActionDispatch::MiddlewareStack.new.tap do |middleware|
rack_cache = config.action_controller.perform_caching && config.action_dispatch.rack_cache

@ -499,7 +499,7 @@ def load_seed
end
initializer :append_asset_paths do
config.asset_path ||= "/#{railtie_name}%s"
config.asset_path ||= default_asset_path
public_path = paths["public"].first
if config.compiled_asset_path && File.exist?(public_path)
@ -553,6 +553,11 @@ def load_seed
end
protected
def default_asset_path
"/#{railtie_name}%s"
end
def routes?
defined?(@routes)
end

@ -95,6 +95,11 @@ def teardown
assert AppTemplate::Application.config.allow_concurrency
end
test "asset_path defaults to nil for application" do
require "#{app_path}/config/environment"
assert_equal nil, AppTemplate::Application.config.asset_path
end
test "the application can be marked as threadsafe when there are no frameworks" do
FileUtils.rm_rf("#{app_path}/config/environments")
add_to_config <<-RUBY