Skip to content

Commit

Permalink
Merge branch 'av-loading-order'
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelfranca committed Dec 5, 2013
2 parents 3eb4f54 + fe13e71 commit 3fcbc7a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion actionview/lib/action_view/railtie.rb
Expand Up @@ -36,7 +36,7 @@ class Railtie < Rails::Railtie # :nodoc:
end
end

initializer "action_view.setup_action_pack", before: :add_view_paths do |app|
initializer "action_view.setup_action_pack" do |app|
ActiveSupport.on_load(:action_controller) do
ActionView::RoutingUrlFor.send(:include, ActionDispatch::Routing::UrlFor)
end
Expand Down
22 changes: 18 additions & 4 deletions railties/test/application/configuration_test.rb
Expand Up @@ -494,15 +494,15 @@ def index
require "#{app_path}/config/environment"
require 'action_view/base'

assert ActionView::Resolver.caching?
assert_equal true, ActionView::Resolver.caching?
end

test "config.action_view.cache_template_loading without cache_classes default" do
add_to_config "config.cache_classes = false"
require "#{app_path}/config/environment"
require 'action_view/base'

assert !ActionView::Resolver.caching?
assert_equal false, ActionView::Resolver.caching?
end

test "config.action_view.cache_template_loading = false" do
Expand All @@ -513,7 +513,7 @@ def index
require "#{app_path}/config/environment"
require 'action_view/base'

assert !ActionView::Resolver.caching?
assert_equal false, ActionView::Resolver.caching?
end

test "config.action_view.cache_template_loading = true" do
Expand All @@ -524,7 +524,21 @@ def index
require "#{app_path}/config/environment"
require 'action_view/base'

assert ActionView::Resolver.caching?
assert_equal true, ActionView::Resolver.caching?
end

test "config.action_view.cache_template_loading with cache_classes in an environment" do
build_app(initializers: true)
add_to_env_config "development", "config.cache_classes = false"

# These requires are to emulate an engine loading Action View before the application
require 'action_view'
require 'action_view/railtie'
require 'action_view/base'

require "#{app_path}/config/environment"

assert_equal false, ActionView::Resolver.caching?
end

test "config.action_dispatch.show_exceptions is sent in env" do
Expand Down

0 comments on commit 3fcbc7a

Please sign in to comment.