Skip to content
This repository
Browse code

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

…tion

As suggested by @jnicklas and @gaizka in #597.
  • Loading branch information...
commit c4247f953b72a4dcbf5e618288fbd657db4111cc 1 parent 0fa83ac
Jo Liss joliss authored

Showing 1 changed file with 10 additions and 8 deletions. Show diff stats Hide diff stats

  1. +10 8 README.md
18 README.md
Source Rendered
@@ -394,14 +394,6 @@ page.should have_css('table tr.foo')
394 394 page.should have_text('foo')
395 395 ```
396 396
397   -If all else fails, you can also use the
398   -<tt>[page.html](http://rubydoc.info/github/jnicklas/capybara/master/Capybara/Session#html-instance_method)</tt>
399   -method to test against the raw HTML:
400   -
401   -```ruby
402   -page.html.should match /<span>.../i
403   -```
404   -
405 397 ### Finding
406 398
407 399 _Full reference: [Capybara::Node::Finders](http://rubydoc.info/github/jnicklas/capybara/master/Capybara/Node/Finders)_
@@ -487,6 +479,16 @@ look at it:
487 479 save_and_open_page
488 480 ```
489 481
  482 +You can also retrieve the current state of the DOM as a string using
  483 +<tt>[page.html](http://rubydoc.info/github/jnicklas/capybara/master/Capybara/Session#html-instance_method)</tt>.
  484 +
  485 +```ruby
  486 +print page.html
  487 +```
  488 +
  489 +This is mostly useful for debugging. You should avoid testing against the
  490 +contents of `page.html` and use the more expressive finder methods instead.
  491 +
490 492 ## Transactions and database setup
491 493
492 494 Some Capybara drivers need to run against an actual HTTP server. Capybara takes

0 comments on commit c4247f9

Please sign in to comment.
Something went wrong with that request. Please try again.