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

Update docs (find(:foo) was removed)

find(:foo) was removed in version 2.0.0 (I don't know the reason but probably it was considered a bad practice). So I think reference to this way should be removed from docs too.
This commit is contained in:
Andrey Botalov 2013-01-07 00:24:46 +03:00
parent 4258c0bc7d
commit ca8cd09409

View file

@ -88,20 +88,12 @@ module Capybara
# page.find('table#myTable').has_selector?(:row, 3) # page.find('table#myTable').has_selector?(:row, 3)
# within(:row, 3) { page.should have_content('$100.000') } # within(:row, 3) { page.should have_content('$100.000') }
# #
# It might be convenient to specify that the selector is automatically chosen for certain # Here is another example:
# values. This way you don't have to explicitly specify that you are looking for a row, or
# an id. Let's say we want Capybara to treat any Symbols sent into methods like find to be
# treated as though they were element ids. We could achieve this like so:
# #
# Capybara.add_selector(:id) do # Capybara.add_selector(:id) do
# xpath { |id| XPath.descendant[XPath.attr(:id) == id.to_s] } # xpath { |id| XPath.descendant[XPath.attr(:id) == id.to_s] }
# match { |value| value.is_a?(Symbol) }
# end # end
# #
# Now we can retrieve elements by id like this:
#
# find(:post_123)
#
# Note that this particular selector already ships with Capybara. # Note that this particular selector already ships with Capybara.
# #
# @param [Symbol] name The name of the selector to add # @param [Symbol] name The name of the selector to add