Permalink
Browse files

Merge branch 'av-loading-order'

  • Loading branch information...
2 parents 3eb4f54 + fe13e71 commit 3fcbc7ad32cf209685485871a4a49c487d131c0d @rafaelfranca rafaelfranca committed Dec 5, 2013
Showing with 19 additions and 5 deletions.
  1. +1 −1 actionview/lib/action_view/railtie.rb
  2. +18 −4 railties/test/application/configuration_test.rb
@@ -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
@@ -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
@@ -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
@@ -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

0 comments on commit 3fcbc7a

Please sign in to comment.