履歴: ソフトウェア/rails/ActiveSupport_TestCase + shoulda によるテスト
各行は、その日時に書かれた内容です。追加・削除は、1 つ前の版との行数の差です (全 13 版)。「差分」は比較する版、「基準」は比べる相手の版を選びます
| 日時 | タイトル | 文字数 | 追加 | 削除 | 内容 | 差分 | 基準 |
|---|---|---|---|---|---|---|---|
| 2014/6/2 9:53:59 | ソフトウェア/rails/ActiveSupport_TestCase + shoulda によるテスト 最新版 | 39,445 | +1 | -1 | 表示 | 差分 | — |
| 2014/6/2 9:53:59 | ソフトウェア/rails/ActiveSupport_TestCase + shoulda によるテスト | 39,451 | +6 | -1 | 表示 | 差分 | 選択 |
| 2014/5/30 14:33:33 | ソフトウェア/rails/ActiveSupport_TestCase + shoulda によるテスト | 39,363 | +2 | -0 | 表示 | 差分 | 選択 |
| 2014/5/30 14:32:24 | ソフトウェア/rails/ActiveSupport_TestCase + shoulda によるテスト | 39,288 | +116 | -17 | 表示 | 差分 | 選択 |
| 2014/5/30 7:58:45 | ソフトウェア/rails/ActiveSupport_TestCase + shoulda によるテスト | 36,014 | +229 | -0 | 表示 | 差分 | 選択 |
| 2014/5/26 4:31:48 | ソフトウェア/rails/ActiveSupport_TestCase + shoulda によるテスト | 29,846 | +11 | -4 | 表示 | 表示中 | 選択 |
| 2014/5/26 4:31:48 | ソフトウェア/rails/ActiveSupport_TestCase + shoulda によるテスト | 29,608 | +30 | -0 | 表示 | 差分 | 基準 |
| 2014/5/24 1:25:48 | ソフトウェア/rails/ActiveSupport_TestCase + shoulda によるテスト | 28,564 | +1 | -1 | 表示 | 差分 | 選択 |
| 2014/5/23 17:42:25 | ソフトウェア/rails/ActiveSupport_TestCase + shoulda によるテスト | 27,825 | +163 | -0 | 表示 | 差分 | 選択 |
| 2014/5/23 13:25:19 | ソフトウェア/rails/ActiveSupport_TestCase + shoulda によるテスト | 21,221 | +174 | -2 | 表示 | 差分 | 選択 |
| 2014/5/23 3:13:32 | ソフトウェア/rails/ActiveSupport_TestCase + shoulda によるテスト | 15,654 | +253 | -88 | 表示 | 差分 | 選択 |
| 2014/5/22 14:25:52 | ソフトウェア/rails/ActiveSupport_TestCase + shoulda によるテスト | 12,435 | +167 | -47 | 表示 | 差分 | 選択 |
| 2014/5/22 13:28:26 | ソフトウェア/rails/ActiveSupport_TestCase + shoulda によるテスト | 9,057 | — | — | 表示 | — | 選択 |
基準: ソフトウェア/rails/ActiveSupport_TestCase + shoulda によるテスト (2014/5/26 4:31:48) → 比較: ソフトウェア/rails/ActiveSupport_TestCase + shoulda によるテスト (2014/5/26 4:31:48)
@@ -447,7 +447,7 @@
** I18n.translate の翻訳の抜けを検出する [#ub2cc8f0]
-config/initializers/test_i18n_translation_strictly.rb
+test/test_i18n_translation_strictly.rb
LANG:ruby(linenumber)
# coding: utf-8
@@ -836,6 +836,8 @@
* shouda の matcher [#gd8d5b05]
+** 一覧 [#m5e4b4ec]
+
#multicolumns
*** [[ActiveModel Matchers>https://github.com/thoughtbot/shoulda-matchers#activemodel-matchers]] [#n7a5004d]
@@ -905,7 +907,7 @@
-redirect_to
-- redirect_to :list
--- redirect_to { posts_path }
+-- redirect_to("description") { posts_path }
-render_template
-- render_template 'show'
-- render_template :show
@@ -932,10 +934,15 @@
くらいかもしれません。
-** matcher の作り方 [#m38d0482]
+** shoulda-matcher の作り方 [#m38d0482]
-set_session のコードを見れば一通り分かりそうですね。
+shoulda の matcher は matches?, description, failure_message などを実装した
+Matcher オブジェクトを作成するファクトリメソッドとして実装されます。
+それが分かっていれば上記 redirect_to_path のように、既存の matcher にパラメータを与えて作成して返すことは簡単にできます。
+
+Matcher クラスを1から自分で作る場合のやりかたは、set_session のコードを見れば一通り分かりそうです。
+
https://github.com/thoughtbot/shoulda-matchers/blob/master/lib/shoulda/matchers/action_controller/set_session_matcher.rb
* 役立ちそうな記事 [#x64e134e]