2015/03/10分のコミットです。
CHANGELOGへの追加はありませんでした。
Revert "Revert integration test refactoring that caused app test regressions"
integration testに関する、三つのコミット(there is always an integration session, so remove the check、lazily create the integration session、use before_setup to set up test instance variables)revertしたコミットをrevertし、再度修正を適応しています。
テストがコケてる件については次のコミットで対応しています。
Call super last in before_setup
actionpack/lib/action_dispatch/testing/integration.rb
の修正です。
before_setup
メソッドの最後でsuperを呼び出すよう修正しています。
def before_setup - super @app = nil @integration_session = nil + super
session初期化前にsuper
を呼んでしまうと、テストの前処理の中でセッション情報の一貫性が保たれず、
データの不整合が起きてしまっているので、super
呼び出す前にセッションをnilで初期化するようにしたようです。恐らく…。
Fix intermittent test failures
activerecord/test/cases/adapters/postgresql/hstore_test.rb
の修正です。
setup
の中でreset_column_information
を呼び出すよう修正しています。
テストの中でtableの情報を変更していまっているものがあり、カラム情報を初期化する為に、reset_column_information
を呼び出すようにしています。
Changed 'blank space' to 'blank line'
rails guideのA Guide to Testing Rails Applications
の修正です。
YAML
の説明の箇所のblank space
をblank line
に説明を修正しています。
remove unnecessary path parameters
activerecord/lib/active_record/associations.rb
の修正です。
autoload
メソッドの引数からパスの指定を削除しています。
- autoload :Association, 'active_record/associations/association' - autoload :SingularAssociation, 'active_record/associations/singular_association' - autoload :CollectionAssociation, 'active_record/associations/collection_association' - autoload :ForeignAssociation, 'active_record/associations/foreign_association' - autoload :CollectionProxy, 'active_record/associations/collection_proxy' + autoload :Association + autoload :SingularAssociation + autoload :CollectionAssociation + autoload :ForeignAssociation + autoload :CollectionProxy
Ruby標準のautoloadではなく、Railsで拡張しているautoload(ActiveSupport::Autoload#autoload
)を使用しており、こちらのメソッドはパスが省略可能(クラス名からパスを組み立てる)なので、削除したようです。
‘test_after_commit’ gem is not required in Rails 5 remove note from doc
activerecord/lib/active_record/transactions.rb
のdocの修正です。
after_commit
のdocからtest_after_commit
gemについての説明を削除しています。
元々はtransactional fixturesを使用していた場合に、after_commit
が実行されず、after_commit
を実行したい場合はtest_after_commit
のようなgemを使用する必要があったのですが、Rails 5からはafter_commit
が実行されるようになり、test_after_commit
を使用する必要は無くなったので、説明を削除しています。