title: How to test a controller with RSpec using a custom url
body: <p>I'm trying to test my <code>SessionsCotroller</code> and have written the following:</p>
  
  <pre><code>   describe "POST create session" do 
          it "should create a new session" do
              params = { session: { email: 'email@example.com', password: 'foobar' } }
              post '/api/signin', params
              response['success'] == true
          end
  
          ...
      end
  </code></pre>
  
  <p>And I'm getting the following error: </p>
  
  <pre><code>Failure/Error: post '/api/signin', params
   ActionController::UrlGenerationError:
     No route matches {:action=&gt;"/api/signin", :controller=&gt;"sessions", :session=&gt;{:email=&gt;"email@example.com", :password=&gt;"foobar"}}
  </code></pre>
  
  <p>What am I doing wrong here?</p>