senny / corner_stones

capybara building blocks for acceptance tests.
18 stars 8 forks source link

Table row detection fails #5

Closed stmichael closed 12 years ago

stmichael commented 12 years ago

If I have a table row like this:

<thead>
  <tr>
    <th>
      Person
    </th>
  </tr>
</thead>
<tbody>
  <tr>
    <td>
      Jack
    </td>
  </tr>
</tbody>

then the row detection fails. CornerStones::Table gives me the following results:

table.rows # => [{"Person"=>"\nJack\n"}]
table.row('Person' => 'Jack') # => nil

This is due to the fact that the row detection checks for string equality.

senny commented 12 years ago

I think we should add some kind of CellTransformer concept. This would allow us to use a variety of different transformations and the user can choose which ones should be applied.

senny commented 12 years ago

you can use the mixin introduced in #12 for the moment: CornerStones::Table::WhitespaceFilter