I get a nil document object when I do the following test: 1. get :new 2. verify that ther is one :document with one section object 3. get :add_section 4. I attempt to verify that the :document has two section objects At step 4 my test fails. -In step 1 the new action sets session[:draft] equal to a new document which contains one section. -In step 3 the add_section action gets the session[:draft] variable and adds one more section to it. Then it redirects to the "new" page. -If I setup my test around the session I see that the add_section action is successful by adding another section to the document. However when I am redirected to the new page and it uses the get_draft method (session[:draft] ||= create_document_with_one_section) I get a nil object reference. I am using the assigns(:document) reference in my test.