plataformatec/devise — Issue #1379: Cancan gem breaks "send password reset instructions"
Author: digitalfrost
Created: 2011-10-12 09:56:19+00:00
State: open

Adding the cancan gem to a Rails 3 App Gemfile breaks Devise's "send password reset instructions" and produces the following error

```
NoMethodError: undefined method `new_session_path' for #
/home/gerald/.rvm/gems/ruby-1.9.2-p290/gems/devise-1.4.8/app/controllers/devise/passwords_controller.rb:48:in `after_sending_reset_password_instructions_path_for'
/home/gerald/.rvm/gems/ruby-1.9.2-p290/gems/devise-1.4.8/app/controllers/devise/passwords_controller.rb:17:in `create'
/home/gerald/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.0.10/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/home/gerald/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.0.10/lib/abstract_controller/base.rb:150:in `process_action'
/home/gerald/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.0.10/lib/action_controller/metal/rendering.rb:11:in `process_action'
/home/gerald/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.0.10/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
/home/gerald/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.0.10/lib/active_support/callbacks.rb:446:in `_run__1739912974408911624__process_action__2985759677419550871__callbacks'
/home/gerald/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.0.10/lib/active_support/callbacks.rb:410:in `_run_process_action_callbacks'
/home/gerald/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.0.10/lib/active_support/callbacks.rb:94:in `run_callbacks'
/home/gerald/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.0.10/lib/abstract_controller/callbacks.rb:17:in `process_action'
/home/gerald/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.0.10/lib/action_controller/metal/rescue.rb:17:in `process_action'
/home/gerald/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.0.10/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
/home/gerald/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.0.10/lib/active_support/notifications.rb:52:in `block in instrument'
/home/gerald/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.0.10/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/home/gerald/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.0.10/lib/active_support/notifications.rb:52:in `instrument'
/home/gerald/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.0.10/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
/home/gerald/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.0.10/lib/abstract_controller/base.rb:119:in `process'
/home/gerald/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.0.10/lib/abstract_controller/rendering.rb:41:in `process'
/home/gerald/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.0.10/lib/action_controller/metal/testing.rb:12:in `process_with_new_base_test'
/home/gerald/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.0.10/lib/action_controller/test_case.rb:412:in `process'
/home/gerald/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.0.10/lib/action_controller/test_case.rb:47:in `process'
/home/gerald/.rvm/gems/ruby-1.9.2-p290/gems/devise-1.4.8/lib/devise/test_helpers.rb:19:in `block in process'
/home/gerald/.rvm/gems/ruby-1.9.2-p290/gems/devise-1.4.8/lib/devise/test_helpers.rb:70:in `catch'
/home/gerald/.rvm/gems/ruby-1.9.2-p290/gems/devise-1.4.8/lib/devise/test_helpers.rb:70:in `_catch_warden'
/home/gerald/.rvm/gems/ruby-1.9.2-p290/gems/devise-1.4.8/lib/devise/test_helpers.rb:19:in `process'
/home/gerald/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.0.10/lib/action_controller/test_case.rb:355:in `post'
/home/gerald/devise_cancan_debug/test/functional/passwords_controller_test.rb:13:in `block in '

```

I've forked the devise example app: https://github.com/digitalfrost/devise_cancan_debug
and added a functional test for "request password reset" to demonstrate the problem.