it "should submit form", :driver => :webkit do
visit '/things/new'
page.should have_content('Login')
fill_in 'user_login', with: @thing.email
fill_in 'user_comment', with: @thing.comment
click_button 'log_in'
save_and_open_page
page.should have_content('Thanks!')
end
浏览器中的响应[内部服务器错误]:
Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id
我猜是thing_controller中的东西或者/ _ / form意外地为零,但我似乎无法确定它是什么。该页面在开发中工作正常(使用填充的数据库)
有没有办法获得更有意义的反馈?
还是我走错了路?
答案 0 :(得分:3)
你可以做几件事。
或锤子法:
答案 1 :(得分:0)
检查您的创建函数是否未手动设置createdf对象id,并且与该对象的任何关系都正确填写了其字段。
我写了检查这些的测试。
您使用的是不同的数据库类型吗?