Permalink
Browse files

Advertise page.html in the Debugging section, not in the Querying sec…

…tion

As suggested by @jnicklas and @gaizka in #597.
  • Loading branch information...
1 parent 0fa83ac commit c4247f953b72a4dcbf5e618288fbd657db4111cc @joliss joliss committed Jan 8, 2012
Showing with 10 additions and 8 deletions.
  1. +10 −8 README.md
View
18 README.md
@@ -394,14 +394,6 @@ page.should have_css('table tr.foo')
page.should have_text('foo')
```
-If all else fails, you can also use the
-<tt>[page.html](http://rubydoc.info/github/jnicklas/capybara/master/Capybara/Session#html-instance_method)</tt>
-method to test against the raw HTML:
-
-```ruby
-page.html.should match /<span>.../i
-```
-
### Finding
_Full reference: [Capybara::Node::Finders](http://rubydoc.info/github/jnicklas/capybara/master/Capybara/Node/Finders)_
@@ -487,6 +479,16 @@ look at it:
save_and_open_page
```
+You can also retrieve the current state of the DOM as a string using
+<tt>[page.html](http://rubydoc.info/github/jnicklas/capybara/master/Capybara/Session#html-instance_method)</tt>.
+
+```ruby
+print page.html
+```
+
+This is mostly useful for debugging. You should avoid testing against the
+contents of `page.html` and use the more expressive finder methods instead.
+
## Transactions and database setup
Some Capybara drivers need to run against an actual HTTP server. Capybara takes

0 comments on commit c4247f9

Please sign in to comment.