问题
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