エントリーの編集
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
Comparing ActiveRecord objects with Rspec
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
Comparing ActiveRecord objects with Rspec
Is there a good way in Rspec to compare two ActiveRecord objects while ignoring id, &c? For examp... Is there a good way in Rspec to compare two ActiveRecord objects while ignoring id, &c? For example, say I'm parsing one object from XML and loading the other from a fixture, and what I'm testing is that my XML parser works correctly. What I currently have is a custom matcher with actual.attributes.reject{|key,v| %w"id updated_at created_at".include? key } == expected.attributes.reject{|key,v| %w"