我不断收到此错误未找到:元素在水豚
Capybara::ElementNotFound:
cannot fill in, no text field, text area or password field with id, name, or label 'Morning' found.
我已经复位叉勺,做了充分的分贝复位,试图分配一个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 %>
您是否添加了'save_and_open_page'命令来确保您位于正确的页面? – depa 2013-03-23 03:41:06
@mdepolli是的,它正在导航到正确的页面。我刚刚创建了该应用程序。此表单页面是迄今为止创建的两个页面之一。 – bwobst 2013-03-23 03:44:09