なるようになるブログ

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

rails commit log流し読み(2015/05/09)

2015/05/09分のコミットです。

CHANGELOGにのったコミットは以下の通りです。

actionmailer/CHANGELOG.md


Better formatted documents [ci skip]

actionview/lib/action_view/helpers/cache_helper.rbのdocの修正です。

CacheHelper#cacheメソッドのdocの、80文字を超えている行の適切な位置に改行を追加、グラマーの修正を行っています。


change GeneratedFeatureMethods to GeneratedAssociationMethods in docs

activerecord/lib/active_record/associations.rbのdocの修正です。

GeneratedFeatureMethods -> GeneratedAssociationMethodsにdoc内のモジュール名を変更しています。モジュール自体の変更は大分前に行われていたのですが、docの修正が漏れていたのを対応しています。


docs: syncing with the code, adding aj [ci skip]

rails guideのThe Rails Initialization Processの修正です。

サンプルとして記載してあるrailties/lib/rails/all.rbが実際の内容と異なる箇所があったので、実際の内容と合わせるよう修正しています。


minor rdoc syntax fix [ci skip]

activemodel/lib/active_model/dirty.rbのdocの修正です。

メソッド名のエスケープを+ -> <tt>に修正しています。


assert_emails in block form use the given number as expected value

actionmailer/lib/action_mailer/test_helper.rbの修正です。

assert_emailsメソッドで、メソッドの引数に指定した期待値と。実際の結果の値が異なる場合に出力されるエラーメッセージ内の、Expectedの値に誤りがあったのを修正しています。

test "notifier mail" do
  NotifierMailer.welcome.deliver_now
  assert_emails 2 do
    NotifierMailer.welcome.deliver_now
  end
end
# before
  1) Failure:
NotifierMailerTest#test_notifier_mail [/home/yaginuma/program/rails/master/test/mailers/notifier_mailer_test.rb:6]:
2 emails expected, but 1 were sent.
Expected: 3
  Actual: 2

# after
  1) Failure:
NotifierMailerTest#test_notifier_mail [/home/yaginuma/program/rails/master/test/mailers/notifier_mailer_test.rb:6]:
2 emails expected, but 1 were sent.
Expected: 2
  Actual: 1

Move TemplateAssertions to their own file

actionpack/lib/action_controller/test_case.rbの中に定義されていたTemplateAssertionsを別ファイル(actionpack/lib/action_controller/template_assertions.rb)に切り出しています。

IntegrationテストとControllerテストのコードを結合する予定があるらしく、その為の準備との事です。


promote :except option instead of :only for before action docs [ci skip]

rails guideのRuby on Rails Security Guideの修正です。

Whitelists versus Blacklistsの項でセキュリティチェック処理が必要なアクションをonlyで指定するのを推奨していたのを、expectでチェック処理が不要な処理を指定するのを推奨するよう修正しています。デフォルトを安全側に倒すようにするため、ですかねえ。