title: Rails 3 and Rspec 2 namespaced controller problems
body: <p>I;m trying to write a spec that tests a controller that is namespaced, let's call it <code>Admin::FooController</code>. My spec is called <code>admin_foo_controller_spec.rb</code>. In the spec, I'm trying to write a very basic spec to see if it can retrieve an action of a controller.</p>
  
  <pre><code>describe "GET 'index'" do
    it "should be successful" do
      get 'index'
      response.should be_success
    end
  end
  </code></pre>
  
  <p>But instead I get an error:</p>
  
  <pre><code> Failure/Error: get 'index'
   No route matches {:controller=&gt;"admin/foo"}
  </code></pre>
  
  <p>For another action, I have basically the same test, and I get that the response is not successful. In the actual webapp, I can access these urls fine. One thing I should mention is that this isn't a RESTful resource (it makes no sense as one) so it's really just a group of related administrative actions, so in my routes.rb it's basically like </p>
  
  <pre><code>namespace :admin do
    scope "foo" do
      match "action1" =&gt; "foo#action1"
      match "action2" =&gt; "foo#action2"
      match "/index" =&gt; "foo#settings"
      match "settings" =&gt; "foo#settings"
    end
  end
  </code></pre>
  
  <p>Any ideas what I'm doing wrong? It seems like namespacing is asking for trouble with rails, especially for a novice like me. Thanks!</p>