黄瓜测试失败,期望假为真

时间:2019-02-25 03:59:08

标签: ruby-on-rails html5

我对使用黄瓜测试还比较陌生,我需要帮助调试和了解我做错了什么。

这是我的html代码:

<div class="card">
  <div class="card-content">
    <span class="card-title">Order History</span>
    <% if @previous_orders.empty? %>
      <p>No orders at this time</p>
    <% else %>
      <table class="striped highlight">
        <thead>
          <th>Date</th>
          <th>Amount</th>
        </thead>
        <% for order in @previous_orders %>
          <tr>
            <td><%= link_to order.date.strftime("%m/%d/%y"), order_path(order) %></td>
            <td>$<%= order.grand_total %></td>
          </tr>
        <% end %>
      </table>
    <% end %>
  </div>
</div>

我的错误是这样的:

And I should see "$22.50"              # features/step_definitions/web_steps.rb:88
      Expected false to be truthy. (Minitest::Assertion)
      ./features/step_definitions/web_steps.rb:92:in `/^(?:|I )should see "([^"]*)"$/'
      features/level_2.feature:56:in `And I should see "$22.50"'

请帮助!

0 个答案:

没有答案