title: Mixed up with rspec assigns while testing controller
body: <p>I'm trying to get a handle on testing controllers, and so far I seem to be stuck on the simplest problems.</p>
  
  <p>documents.controller:</p>
  
  <pre><code>    def edit
        @document = Document.find(params[:id])
      end
  </code></pre>
  
  <p>documents_controller_spec:</p>
  
  <pre><code>    describe 'GET #edit', focus: true do
        before(:each) { @doc = FactoryGirl.create(:document)}
  
        it "should assign @document to the document" do
          get :edit, id: @doc
          assigns(:document).should eq(@doc)
        end
      end
  </code></pre>
  
  <p>Always returns false. @document is always assigned nil. I've tried specifying params[id] to be @doc.id, but that doesn't fix anything. What am I doing wrong here?</p>