我试图使用capybara rspec并得到这个错误:无法找到字段“名称”(Capybara :: ElementNotFound)
这是我的形式:
%h2 Sign up = simple_form_for(resource,:as => resource_name,:url => registration_path(resource_name),:html => {:class => 'form-vertical' }) do |f| = f.error_notification = display_base_errors resource = f.input :name,:autofocus => true = f.button :submit,'Sign up',:class => 'btn-primary' = render "devise/shared/links"
这是我的user_steps.rb
When /^I sign up with valid user data$/ do create_visitor sign_up end def create_visitor @visitor ||= { :name => "Test visitor"} end def sign_up visit '/users/sign_up' fill_in "Name",:with => @visitor[:name] click_button "Sign up" end
怎么了????