0
0

More than 3 years have passed since last update.

rspecで実行している動作をbinding.pryを確認する方法【メモ】

Posted at
$ pry(..)> val

have_content()メソッドでビューのテストもしている場合、テストでは画面が出てこないので、変数の中身がわかるだけではデバッグしようがない。

そんなときは今見ているURLを確認。なんらかの原因で違うURLを見てる場合もある。

$ pry(..)> current_url

URLは問題ないとなれば、実際にHTMLをチェック。

$ pry(..)> page.html

か、もしくはテキストだけをチェックもできる。

$ pry(..)> page.text

Capybaraチートシート

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0