如何使用Capybara和RSpec检查会话哈希?

在Stack Overflow上找到关于此的各种post,但没有找到解决方案。

在集成测试中,如何使用Capybara和RSpec检查会话哈希?

puts session.inspect undefined method for nil错误抛出一个undefined method for nil

根据您的评论,您需要调试,以便您可以使用:

 save_and_open_page 

拍摄页面的快照并查看它,或者您可以使用:

 print page.html 

如果要以字符串forms检索DOM的当前状态

来源: Capybara调试