在我的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元素?