title: How to test POST routes in Laravel
body: <p>I'm doing the following to test a POST call to Laravel. I'm expecting that POST to questions, in accordance with my routes, will be dispatches as the store action method. This works in the browser.</p>
  
  <p>My test:</p>
  
  <pre><code>public function setUp()
      {   
          parent::setUp();
  
          Session::start();
      }
  
      public function testStoreAction()
      {
          $response = $this-&gt;call('POST', 'questions', array(
              '_token' =&gt; csrf_token(),
          ));
  
          $this-&gt;assertRedirectedTo('questions');
      }
  </code></pre>
  
  <p>However, I tells me that the redirect doesn't match. Also, I can see that it isn't going to the store action method at all. I want to know what action method it is going to, and why it isn't going to the store method (if I look at route:list I can see there is a POST questions/ route that should go to questions.store; this also works in the browser, but not in my tests). Also, am I writing the call correctly for this resource? I added the token here as it was throwing an exception as it should, in some tests I will let the token check pass.</p>