rspec issue with 1.1.1

103 views
Skip to first unread message

seb

unread,
Jul 30, 2010, 2:01:19 PM7/30/10
to Devise
Hi

I upgrade a project from rails 2 to rails 3. I use devise 1.1.1 and
rails 3rc I have an issue on any spec.

The simpler spec on registrations#new is:

describe "GET 'new'" do
it "should be successful" do
get :new
response.should be_success
end
end

I got
Failure/Error: get :new
AbstractController::ActionNotFound
# /Users/seb/.rvm/gems/ruby-head@navia/gems/devise-1.1.1/lib/
devise/controllers/internal_helpers.rb:55:in `is_devise_resource?'

I think it's because request.env["devise.mapping"] is not set.

Any idea?

José Valim

unread,
Jul 30, 2010, 2:02:34 PM7/30/10
to plataforma...@googlegroups.com
Please check the session Configuring Routes in the README.

----
José Valim

Director of Engineering - Plataforma Tecnologia
Know more about us: http://plataformatec.com.br/en/

José Valim

unread,
Jul 30, 2010, 2:46:04 PM7/30/10
to plataforma...@googlegroups.com
Ah, sorry for my earlier reply. Yes, this is a bug in how Rails/RSpec organize controller specs. The best you can do is to set it manually in a before filter.

  request.env["devise.mapping"] = Devise.mapping[:users]

Could you please add it to the wiki as well? Thanks!

----
José Valim

Director of Engineering - Plataforma Tecnologia
Know more about us: http://plataformatec.com.br/en/


Sébastien Gruhier

unread,
Jul 30, 2010, 4:13:33 PM7/30/10
to plataforma...@googlegroups.com
Sure it ll test it and update the wiki
Thanks a lot José

Sent from my iPhone
Reply all
Reply to author
Forward
0 new messages