art*_*ave 8 testing integration-testing ruby-on-rails cucumber
似乎cuke没有显示完整的错误消息(至少在模板中出现问题时),这使得很难找到问题.
以下是它输出的一些错误:
...
And I am on checkout page # features/step_definitions/webrat_steps.rb:6
You have a nil object when you didn't expect it!
The error occurred while evaluating nil.items (ActionView::TemplateError)
features/manage_orders.feature:9:in `And I am on checkout page'
...
以下是rails在浏览器中重现相同问题时显示的内容:
Showing app/views/cart/show.erb where line #46 raised:
You have a nil object when you didn't expect it!
The error occurred while evaluating nil.items
Extracted source (around line #46):
43: </script>
44:
45: <% ths = %w{th_title th_price th_subtotal th_quantity}.collect {|th| t th.intern} %>
46: <% table(@cart.items, ths) do |cart_item, style| -%>
47: <tr class="<%= style %>">
48: <td width="60%"><%=h cart_item.title %></td>
49: <td width="20%"><%=number_to_currency cart_item.price %></td>
Run Code Online (Sandbox Code Playgroud)
前者有点太整洁了.在cucumber.log中也没有例外.我的模板有很少的部分和布局.没有线索,相当调查.
是否有任何秘密插头来获取黄瓜显示完整错误?
| 归档时间: |
|
| 查看次数: |
3637 次 |
| 最近记录: |