Capybara :: ElementNotFound:无法找到未禁用的字段“ order [message]”

时间:2019-09-30 23:28:16

标签: ruby-on-rails ruby rspec

在我的spec.rb测试文件fill_in "order[message]", with: "Don't eat paint chips!"中 出现此错误失败。

Capybara::ElementNotFound:
  Unable to find field "order[message]" that is not disabled

这是我的html.erb

<%= form_with model: @order, url: "/gift/orders", local: true  do |form| %> 
  .
  .
  <div class="form-group col-md-12">
      <%= form.label :message, "Note for the child" %>
      <%= form.text_field :message, class: "form-control", :rows => "3" %>
      <small id="passwordHelpBlock" class="form-text text-muted">
        Optional
      </small>
  </div> 
  .
  .
<% end %>

为什么我的测试无法读取form元素?

0 个答案:

没有答案