title: rails test passing CSRF token only in get requests
body: <p>I'm trying to unit-test my controllers, every test that uses the <code>get</code> request works fine, but the tests where I use other calls (<code>delete</code> in destroy, <code>post</code> in create and <code>put</code> in update) fail with a: </p>
  
  <pre><code>WARNING: Can't verify CSRF token authenticity
  Completed 401 Unauthorized in 2.5ms
  </code></pre>
  
  <p>for example this is the test for destroy: </p>
  
  <pre><code>  test "should destroy blog" do
      assert_difference('Blog.count', -1) do
        delete :destroy, id: @blog
      end
  
      assert_redirected_to blogs_path
    end
  </code></pre>
  
  <p>which doesn't work</p>
  
  <p>and this is the test for show, which works: </p>
  
  <pre><code>  test "should show blog" do
      get :show, id: @blog
      assert_response :success
    end
  </code></pre>
  
  <p>in the destroy test the devise <code>authenticate_user!</code> just redirects me to the sign_in page and the test fails. </p>