Topic: Controller test fails on get_new
I'm new to rails so sorry if I'm asking something simple but I'm stuck on this.
When I try to test a particular controller that forms part of a one to many relationship with a users table created by authlogic I get the following error for the get_new test
RuntimeError: Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id
I had the same error when adding a new business through the page itself and on following advise from Dana on the site I added the following to my new method in the actual business controller
@business = Business.new(:user_id => current_user.id)
However I can't figure out how to implement this in the testing side of things, I've tried to edit the get_new test to the following
test "should get new" do
but to no avail can anyone give me a few pointers on this.