次のステップがあります。
Then I should see the following games:
| soccer | 94040 | "friendly" |
| basketball | 94050 | "competition"|
そして、次のステップ定義があります。
Then /^I should see the following games:$/ do |expected_table|
table_results = page.find('#games_results_table')
end
もしそうなら、私はputs table_results
得る:
#<Capybara::Element tag="table" path="/html/body/div[2]/table">
expected_table と table_results を比較するために、これを試してみました。
expected_table.diff!(table_results)
しかし、私はこのエラーが発生します:
undefined method `transpose' for #<Capybara::Element tag="table" path="/html/body/div[2]/table"> (NoMethodError)
テーブルをレンダリングしているビューが次のようになっていることに注意してください。
<div class="page-header">
<h1>Games</h1>
<table id="games_results_table" class="table table-striped">
<tr>
<th>Sport Type</th>
<th>Zip Code</th>
<th>Description</th>
</tr>
<% @games.each do |game| %>
<tr>
<td><%= game.sport_type %></td>
<td><%= game.zip_code %></td>
<td><%= game.description %></td>
</tr>
<% end %>
</table>
</div>
私は何を間違っていますか?