title: How to write controller tests when you override devise registration controller?
body: <p>I wish to override the <code>Devise::RegistrationsController</code> to implement some custom functionalality. To do this, I've created a new <code>RegistrationsController</code> like so:</p>
  
  <pre><code># /app/controllers/registrations_controller.rb
  class RegistrationsController &lt; Devise::RegistrationsController
    def new
      super
    end
  end
  </code></pre>
  
  <p>and set up my routes like this:</p>
  
  <pre><code>devise_for :users, :controllers =&gt; { :registrations =&gt; "registrations" }
  </code></pre>
  
  <p>and tried to test it like this:</p>
  
  <pre><code>describe RegistrationsController do
    describe "GET 'new'" do
      it "should be successful" do
        get :new
        response.should be_success
      end
    end
  end
  </code></pre>
  
  <p>but that gives me an error:</p>
  
  <pre><code> 1) RegistrationsController GET 'new' should be successful
   Failure/Error: get :new
   AbstractController::ActionNotFound:
     Could not find devise mapping for path "/users/sign_up".
     Maybe you forgot to wrap your route inside the scope block? For example:
  
         devise_scope :user do
           match "/some/route" =&gt; "some_devise_controller"
         end
   # ./spec/controllers/registrations_controller_spec.rb:13:in `block (3 levels) in &lt;top (required)&gt;'
  </code></pre>
  
  <p>So what am I doing wrong?</p>