title: RSpec tests with devise: could not find valid mapping
body: <p>I'm trying to run controller specs with devise 1.3.4. (and factory girl)
  I followed the instructions in the git wiki for the project.  I am able to log in as a user using the login_user method created in the macro, but login_admin fails with the following error:</p>
  
  <pre><code>...
  sign_in Factory.create(:admin)
  
  Could not find a valid mapping for #&lt;User id: 2023, email: "admin1@gmail.com", .... &gt;
  </code></pre>
  
  <p>Factory:</p>
  
  <pre><code>Factory.define :user do |f|
    f.sequence(:username) {|n| "user#{n}"}
    f.sequence(:email) {|n| "user#{n}@gmail.com"}
    f.email_confirmation {|fac| fac.email }
    f.password "a12345Den123"
    f.password_confirmation "a12345Den123"
  #  f.admin 0
  end
  
  Factory.define :admin, :class =&gt; User do |f|
    f.sequence(:username) {|n| "admin#{n}"}
    f.sequence(:email) {|n| "admin#{n}@gmail.com"}
    f.email_confirmation {|fac| fac.email }
    f.password "a12345Den123"
    f.password_confirmation "a12345Den123"
    f.admin 1
  end
  </code></pre>
  
  <p>Controller macros module:</p>
  
  <pre><code>module ControllerMacros
    def login_admin
      before(:each) do
        @request.env["devise.mapping"] = Devise.mappings[:user]  #it should map to user because admin is not a model of its own.  It produces the same result either way.
        @admin = Factory.create(:admin)
        sign_in @admin
      end
    end
  
    def login_user
      before(:each) do
        @request.env["devise.mapping"] = Devise.mappings[:user]
        @user = Factory.create(:user)
        sign_in @user
      end
    end
  end
  </code></pre>
  
  <p>routes</p>
  
  <pre><code>devise_for :users
  devise_for :admins, :class_name =&gt; 'User'
  </code></pre>
  
  <p>One solution is to set cache_classes = false, however that isn't ideal as I use spork and don't want to have to restart it after changing a model.</p>
  
  <p>Any help?</p>