Reputation: 3031
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
response in browser [internal server error]:
Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id
I'm guessing something in the things_controller or things/_form is unexpectedly nil, but I can't seem to nail down what it is. The page works fine in development (with populated database)
Is there a way to get more meaningful feedback?
or am I on the wrong track?
Upvotes: 2
Views: 562
Reputation: 334
Check that your create function is not manually setting the createdf objects id and that any relations to that object are having their fields properly filled in.
I.e write tests that check these.
Are you using different db types?
Upvotes: 0
Reputation: 18835
there are several things you can do.
or the hammer-method:
Upvotes: 3