I reproduced the issue I’m getting in a simple rails project available at github :
Running rails 3.1rc4:
https://github.com/demental/devise_sti
Running rails 3.0.9:
https://github.com/demental/devise_sti_rails3
Basically :
- I have a User model, that uses devise behaviour
- I have Admin model that inherits from User
- I have two devise resources in my routing.
When signing in as an Admin, I get rejected by the authenticate_admin! filter, just like if I was a User.
I don’t know if it’s an issue or if I did something wrong… any idea ?
Answering to myself:
I have two ways to avoid this issue, that occured only when running tests: