1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00

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

As suggested by @jnicklas and @gaizka in #597.
This commit is contained in:
Jo Liss 2012-01-08 19:53:31 +01:00
parent 0fa83acbe8
commit c4247f953b

View file

@ -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