senny / corner_stones

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

table: handling of colspan #35

Open bjoernbur opened 11 years ago

bjoernbur commented 11 years ago

@senny

i've got a little question about the handling of colspans in corner_stones:

at the moment a cell with colspan is handled like a normal cell without colspan e.g.:

<table>
  <tr>
    <th>Date</th>
    <th>State</th>
   <th>Sum</th>
  </tr>
  <tr>
    <td colspan="2">Total</td>
    <td>1000</td>
  </tr>
</table>

with this table you get the following row-hash:

{ 'Date' => 'Total', 'State' => 1000, 'Sum' => nil }

i would expect the following:

{ 'Date' => 'Total', 'State' => nil, 'Sum' => 1000 }

or even that:

{ 'Date' => 'Total', 'Sum' => 1000 }

what do you think about that?

senny commented 11 years ago

Generally you are right. However I don't want to build a table renderer. If we can provide a good solution with a reasonable amount of code I'd accept a PR. If it get's too complicated I would advise not to use corner_stones for this purpose.