How to inspect the session hash with Capybara and RSpec?

六月ゝ 毕业季﹏ 提交于 2019-12-11 04:16:45

问题


Found various posts about this on Stack Overflow, but didn't find a solution.

From within an integration test, how to inspect the session hash with Capybara and RSpec?

puts session.inspect throws an undefined method for nil error.


回答1:


Based on your comment you need debugging so you can use:

save_and_open_page

to take a snapshot of a page and take a look at it, or you can use:

print page.html

if you want to retrieve the current state of the DOM as a string

Source: Capybara debugging



来源:https://stackoverflow.com/questions/12083296/how-to-inspect-the-session-hash-with-capybara-and-rspec

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!