2016/08/25分のコミットです。
CHANGELOGへの追加はありませんでした。
Merge pull request #26235 from samphippen/allow-early-setting-of-integration-session
actionpack/lib/action_dispatch/testing/integration.rb
の修正です。
ActionDispatch::Integration::Runner#before_setup
で行っていたintegration_session
の初期化処理を、ActionDispatch::Integration::Runner#initialize
で行うよう修正しています。
元々はbefore_setup
でnilに初期化するようになっていたのですが、それだとRSpecでbefore(:all)
でsessionに値を設定した場合でも、必ずnilで初期化されてしまう、という問題があった為、initialize
を追加し、そちらで初期化処理を行うよう修正したとの事です。
actionview/lib/action_view/helpers/cache_helper.rb
、
actionview/lib/action_view/renderer/partial_renderer.rb
の修正です。
cache hitしたかどうかの情報を保持するのにpayload用のHashに値を保持していたのを、ActionView::Helpers::CacheHelper
にcache_hit
変数を作成し、そちらを使用するよう修正しています。
actionview/lib/action_view/template.rb
の修正です。
既に他の箇所でfreezeを行っている為に不要なStringのfreeze処理を削除しています。
kick different instrumentation method
actionview/lib/action_view/template.rb
の修正です。
ActionView::Template#instrument
の中で特定のactionの場合のみ特別な処理があったのを、そのactionについては別途そのaction用のinstrumentメソッド(#instrument_render_template
)を追加しそちらを呼ぶ出すようにし、#instrument
メソッドの中では分岐処理行わないよう修正しています。
Add load hooks to all tests classes
各コンポーネントのテスト用クラス(ActionMailer::TestCase
、ActionController::TestCase
、ActionView::TestCase
、ActiveJob::TestCase
)にそれぞれload hookを追加しています。
module ActiveJob class TestCase < ActiveSupport::TestCase include ActiveJob::TestHelper + + ActiveSupport.run_load_hooks(:active_job_test_case, self) end end
当然 hook名はActionMailer::TestCase
の場合はaction_mailer_test_case
、ActionController::TestCaseの場合は
action_controller_test_case`のようになっています。
各テスト用クラスを拡張したい場合、今まではActionView::TestCase.include MyCustomTestHelpers
のようにクラスに対して直接include
を実行する必要があったのですが、これだとActionController::Base
のload hookが実される事なくload処理が実行されてしまう(ActionView::TestCase
のload処理の延長でActionController::Base
のloadも行われる為)ので、それを避ける為に、各テスト用クラスそれぞれにload hookを追加したとの事です。
actionpack/lib/action_controller/test_case.rb
の修正です。
hook名をaction_controller_test_case
とすべきところをaction_view_test_case
とタイポしていたのを修正しています。