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

Merge pull request #1597 from jaredbeck/patch-1

Docs: Another example of `Capybara.string`
This commit is contained in:
Thomas Walpole 2016-01-14 13:52:03 -08:00
commit 710bc5dca9

View file

@ -140,7 +140,16 @@ module Capybara
# in a {Capybara::Node::Simple} which exposes all {Capybara::Node::Matchers},
# {Capybara::Node::Finders} and {Capybara::Node::DocumentMatchers}. This allows you to query
# any string containing HTML in the exact same way you would query the current document in a Capybara
# session. For example:
# session.
#
# Example: A single element
#
# node = Capybara.string('<a href="foo">bar</a>')
# anchor = node.first('a')
# anchor[:href] #=> 'foo'
# anchor.text #=> 'bar'
#
# Example: Multiple elements
#
# node = Capybara.string <<-HTML
# <ul>