2015/11/04分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
Add tests to make sure mail_to work with nil and SafeBuffer
actionview/test/template/url_helper_test.rb
の修正です。
mail_to
メソッドにSafeBuffer
、またはnil
を指定した場合のテストを追加しています。
4系(4.1、4.2両方)で上記を指定した場合に正しく動作しなかった(masterは問題無かった)為、リグレッション防止の為に、テストだけ追加されているようです。
Update docs/comments to use setup/teardown blocks vs. methods.
activesupport/lib/active_support/log_subscriber/test_helper.rb
、
guides/source/active_model_basics.md
、
guides/source/testing.md
の修正です。
テストの前処理/後処理でsetup
/teardown
メソッドを使用していたのを、setup
/teardown
blockを使用するよう修正しています。
class ArticlesControllerTest < ActionController::TestCase # called before every single test - def setup + setup do @article = articles(:one) end # called after every single test - def teardown + teardown do # when controller is using cache it may be a good idea to reset it afterwards Rails.cache.clear end
元々、railsとしてはblockの方を使うよう推奨していたのと、メソッドの方を使った場合に、minitest-spec-rails
で問題があった(before/setup inconsistency · Issue #68 · metaskills/minitest-spec-rails)ようで、blockの方を使用するよう統一しています。
Fix deprecation message when frame doesn't have absolute_path
activesupport/lib/active_support/deprecation/reporting.rb
の修正です。
ActiveSupport::Deprecation.extract_callstack
メソッドで、問題が発生した行を特定する際に、frameがnilの場合の考慮を追加しています。
rails_gem_root = File.expand_path("../../../../..", __FILE__) + "/" offending_line = callstack.find { |frame| - !frame.absolute_path.start_with?(rails_gem_root) + frame.absolute_path && !frame.absolute_path.start_with?(rails_gem_root) } || callstack.first [offending_line.path, offending_line.lineno, offending_line.label]
Don’t allow arbitrary data in back urls
actionview/lib/action_view/helpers/url_helper.rb
の修正です。
link_to
メソッドに:back
オプションを指定した場合、HTTP_REFERER
ヘッダーが設定されていたらその値、ヘッダーが無ければjavascript:history.back()
を返すようになっていましした。
ただ、HTTP_REFERER
ヘッダーの値を返す際、値のチェックは行っていなかったので、仮にjavascript:alert("!")
のようなJSが設定されていた場合に、それがそのまま実行されてしまっていました。
これを、HTTP_REFERER
の値をチェックして、javascript
スキームの場合はその値は使用しないよう修正しています。
don't start a new process for every test file
railties/Rakefile
の修正です。
テストをパラレルに実行する際、テストファイル毎にプロセスを生成していたのを、一度作ったプロセスを使いまわすよう修正しています。
activerecord/CHANGELOG.md
の修正です。
deprecated
をdepreacted
にタイポしていたのを修正しています。