have_table matcher¶ ↑
This gem provides a custom matcher for testing tables in an intuitive way.
Requirements¶ ↑
Currently only works for tables with headers, and no colspans or rowspans.
eg:
response.should have_table do with_row do with_cell("Username" => "jsmith") with_cell("First Name" => "John") with_cell("Last Name" => "Smith") with_cell("Email" => "jsmith@email.com") end end
matches:
<table> <tr> <th>Username</th> <th>First Name</th> <th>Last Name</th> <th>Email</th> </tr> <tr> <td>jsmith</td> <td>John</td> <td>Smith</td> <td>jsmith@email.com</td> </tr> </table>