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

failure message now takes a second argument

This commit is contained in:
Jonas Nicklas 2011-03-10 22:39:52 +01:00
parent 944e3d8af7
commit 3eaeccca9f

View file

@ -83,7 +83,7 @@ shared_examples_for "find" do
it "should raise an error with the failure message if the element is not found" do
Capybara.add_selector(:monkey) do
xpath { |num| ".//*[contains(@id, 'monkey')][#{num}]" }
failure_message { |node| node.all(".//*[contains(@id, 'monkey')]").map { |node| node.text }.sort.join(', ') }
failure_message { |node, selector| node.all(".//*[contains(@id, 'monkey')]").map { |node| node.text }.sort.join(', ') }
end
running do
@session.find(:monkey, '14').text.should == 'Monkey Paul'