title: Testing GET in a rails controller
body: <p>I have a feeling I'm just doing something wrong syntactically but it's surprisingly difficult to Google "GET" so I was hoping someone here might know the answer to this. </p>
  
  <p>I'm trying to test a Rails controller from an RSpec test. I'm following an example I found here - <a href="http://www.elevatedrails.com/articles/2007/09/10/testing-controllers-with-rspec/" rel="nofollow noreferrer">http://www.elevatedrails.com/articles/2007/09/10/testing-controllers-with-rspec/</a> but I'm stuck on the actual execution of the method I'm testing. </p>
  
  <p>I'm doing a GET request where as the post above does a POST. I'm passing in 2 parameters manufacturer and model. </p>
  
  <p>My URL will ideally look something like <a href="http://mysite.com/Products/index/Manufacturer/ModelName" rel="nofollow noreferrer">http://mysite.com/Products/index/Manufacturer/ModelName</a></p>
  
  <p>I can't figure out the syntax for the get request call in the rest. Right now I have </p>
  
  <pre><code>get :index, :manufacturer=&gt;@manufacturer, :modelName=&gt;@modelName
  </code></pre>
  
  <p>and I get back </p>
  
  <blockquote>
    <p>ArgumentError in 'ProductController Find a valid product should retrieve the product'
    wrong number of arguments (0 for 2)</p>
  </blockquote>
  
  <p>Any thoughts?</p>
  
  <p>edit: It should be noted @manufacturer and @modelName are defined in before(:each)</p>