have_table_row waits

This commit is contained in:
Rohan Mitchell
2014-05-15 16:20:02 +10:00
parent 5f4e4ebeb0
commit ba7e29074f

View File

@@ -2,7 +2,14 @@ RSpec::Matchers.define :have_table_row do |row|
match do |node|
@row = row
node.all('tr').map { |tr| tr.all('th, td').map(&:text) }.include? row
begin
wait_until { node.all('tr').map { |tr| tr.all('th, td').map(&:text) }.include? row }
rescue TimeoutError
false
else
true
end
end
failure_message_for_should do |text|