我不斷收到此錯誤未找到:元素在水豚
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