require 'helper' class TestCapybaraExtensions < Test::Unit::TestCase should "find a node's parent" do html = <<-EOM
a
b
EOM doc = Capybara.string(html) assert_equal doc.find('#child').parent[:id], 'parent' end end