なるようになるブログ

読書感想文かrailsについてかrubyについてか

rails commit log流し読み(2016/09/15)

2016/09/15分のコミットです。

CHANGELOGへの追加はありませんでした。


Improve assert_response helper

actionpack/lib/action_dispatch/testing/assertions/response.rbの修正です。

assert_responseでエラーになった際に、response bodyの内容が表示するよう修正しています。

Before:

ThemeEditorIntegrationTest#test_whatever
    Expected response to be a <200: ok>, but was a <422: Unprocessable Entity>.
Expected: 200
  Actual: 422

After:

ThemeEditorIntegrationTest#test_whatever
    Expected response to be a <200: ok>, but was a <422: Unprocessable Entity>.
Expected: 200
  Actual: 422
Response body: {"errors":["Invalid settings object for section '1'"]}

なお、response bodyが大きすぎる(sizeが500より大きい)場合は表示しないようになっています。


Correct render text: deprecation message

actionpack/lib/action_controller/metal/rendering.rbの修正です。

render :textを使用した際に表示するdeprecation messageに、defaultのContent-Typeはtext/plainである旨説明が記載されていたのですが、実際はtext/htmlなため、その旨修正しています。


Merge pull request #26469 from y-yagi/remove_useless_option

railties/test/isolation/abstract_unit.rbの修正です。

テスト用のRails appを作成する用のメソッド(build_app)にGemfileを削除するかどうかを制御する為のgemfileというオプションを渡せるようになっていたのですが、実際はテスト用のRails appを作成する際--skip-gemfileを指定しており、オプションの指定に関わらずGemfileは生成されないようになっており、オプションは意味が無かったのでオプションを削除しています。


bug report template for migrations (#26488)

migration用のbug report templateファイルを追加しています。