title: Why does the second 'delete :destroy' in this spec not run?
body: <p>I have a spec that is giving unexpected results. I've not been able to track down the cause. Can anyone help point me in the right direction? </p>
  
  <pre><code>let(:object1) { create :object }
  let(:object2) { create :object }
  let(:user)    { create :user }
  describe "DELETE #destroy" do
    before :each do
      Rails.logger.info "Object 1 ID: #{object1.id}"
      Rails.logger.info "Object 2 ID: #{object4.id}"
      user.roles.push Role.where(name: 'FullAccess').first
      sign_in user
      delete :destroy, {:id =&gt; object1.to_param}
    end
    it {
       expect {
         delete :destroy, {:id =&gt; object2.to_param}
       }.to change(Object, :count).by(-1)
    }
  end 
  </code></pre>
  
  <p>Results in </p>
  
  <pre><code>Failure/Error:
    expect {
      delete :destroy, {:id =&gt; object2.to_param}
    }.to change(Object, :count).by(-1)
  expected #count to have changed by -1, but was changed by 0
  </code></pre>
  
  <p>But if I comment out <code>delete</code> in the before block, the test passes. </p>
  
  <pre><code>before :each do
    sign_in user
    # delete :destroy, {:id =&gt; office1.to_param}
  end
  </code></pre>
  
  <p>Why would the second object not be deleted?</p>
  
  <h2>edit</h2>
  
  <p>The method being tested is</p>
  
  <pre><code>def ObjectController &lt; ApplicationController
    load_and_authorize_resource
    def destroy
      Rails.logger.info "DELETE OBJECT ID: #{@object.id}" 
      @object.destroy
      respond_to do |format|
        format.html { redirect_to objects_url, notice: t('.notice') }
        format.json { head :no_content }
      end
    end
  end
  </code></pre>
  
  <h2>Edit 2</h2>
  
  <p>Added logging codes to the examples above. The log output now includes</p>
  
  <pre><code>Object 1 ID: 1
  Object 2 ID: 2
  DELETE OBJECT ID: 1 
  DELETE OBJECT ID: 1 
  </code></pre>