mirror of
https://github.com/github/rails.git
synced 2026-04-04 03:00:58 -04:00
Ensure ActionView::Helpers::AssetTagHelper::AssetTag::Cache is cleared before loading so changes to asset files are picked up by the broswer [#1233 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
This commit is contained in:
@@ -39,7 +39,7 @@ module ActionController
|
||||
# Add a preparation callback. Preparation callbacks are run before every
|
||||
# request in development mode, and before the first request in production
|
||||
# mode.
|
||||
#
|
||||
#
|
||||
# An optional identifier may be supplied for the callback. If provided,
|
||||
# to_prepare may be called again with the same identifier to replace the
|
||||
# existing callback. Passing an identifier is a suggested practice if the
|
||||
@@ -144,6 +144,7 @@ module ActionController
|
||||
|
||||
Routing::Routes.reload
|
||||
ActionController::Base.view_paths.reload!
|
||||
ActionView::Helpers::AssetTagHelper::AssetTag::Cache.clear
|
||||
end
|
||||
|
||||
# Cleanup the application by clearing out loaded classes so they can
|
||||
|
||||
@@ -26,9 +26,17 @@ class DispatcherTest < Test::Unit::TestCase
|
||||
end
|
||||
|
||||
def test_clears_dependencies_after_dispatch_if_in_loading_mode
|
||||
ActionController::Routing::Routes.expects(:reload).once
|
||||
ActiveSupport::Dependencies.expects(:clear).once
|
||||
dispatch(@output, false)
|
||||
end
|
||||
|
||||
def test_reloads_routes_before_dispatch_if_in_loading_mode
|
||||
ActionController::Routing::Routes.expects(:reload).once
|
||||
dispatch(@output, false)
|
||||
end
|
||||
|
||||
def test_clears_asset_tag_cache_before_dispatch_if_in_loading_mode
|
||||
ActionView::Helpers::AssetTagHelper::AssetTag::Cache.expects(:clear).once
|
||||
dispatch(@output, false)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user