我不断收到此错误:
Capybara::ElementNotFound:
cannot fill in, no text field, text area or password field with id, name, or label 'Morning' found.
我已经重置了 spork,完成了完整的数据库重置,尝试为表单元素分配一个 ID,等等。这可能是什么问题?
days_controller_spec.rb
require 'spec_helper'
describe DaysController do
describe "New" do
describe "with valid information" do
it "should create a new entry" do
visit 'days#new'
fill_in "Morning", with: "Test"
click_button "Submit"
end
end
end
end
days_controller.rb
<%= form_for @day do |f| %>
<%= f.label :morning %>
<%= f.text_field :morning %>
<%= f.button :submit %>
<% end %>