# LoginEngine UserController fails tests

**URL:** <https://www.ruby-forum.com/t/loginengine-usercontroller-fails-tests/65437>\
**Category:** Engines Development\
**Created:** [August 18, 2006, 5:22am UTC](https://www.ruby-forum.com/t/loginengine-usercontroller-fails-tests/65437 "2006-08-18T05:22:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jay-levitt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a88e57/32.png) [@jay-levitt](https://www.ruby-forum.com/u/jay-levitt)\
**Post date:** [August 18, 2006, 5:22am UTC](https://www.ruby-forum.com/t/loginengine-usercontroller-fails-tests/65437/1 "2006-08-18T05:22:24Z")

</div>

Using Rails 1.1.6, engines 1.1.4, and either LoginEngine 1.0.2 or trunk,  
I  
see a bunch of errors running user\_controller\_test.rb, along the lines  
of:

Exception: undefined method `redirect_to_stored_or_default' for #<UserController:0x4e039a8> /cygdrive/c/dev/src/eclipse/AuthEngine2/config/../vendor/plugins/login_engine/app/controllers/user_controller.rb:25:in`login’

I’m a little fuzzy on how that method (which is defined in  
lib/authenticated\_system.rb) should have been available to  
UserController  
anyway. But it doesn’t seem to be anymore.

What might have changed in engines or (more likely, I’m guessing) Rails  
dependency resolving?

Jay

---

<div class="post-metadata">

**Author:** ![jay-levitt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a88e57/32.png) [@jay-levitt](https://www.ruby-forum.com/u/jay-levitt)\
**Post date:** [August 22, 2006, 2:06am UTC](https://www.ruby-forum.com/t/loginengine-usercontroller-fails-tests/65437/2 "2006-08-22T02:06:49Z")

</div>

On Fri, 18 Aug 2006 16:32:09 +0100, Jon L. wrote:

> On 18/08/06, Jay L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Using Rails 1.1.6, engines 1.1.4, and either LoginEngine 1.0.2 or trunk, I  
> > see a bunch of errors running user\_controller\_test.rb, along the lines of:
> > 
> > Exception: undefined method `redirect\_to\_stored\_or\_default’ for  
> > #UserController:0x4e039a8

Figured out what was causing this. I was testing in an empty  
application,  
and though I’d added Engines.start to environment.rb, I hadn’t added  
“require ‘login\_engine’” to controllers/application.rb. So controllers  
weren’t getting the AuthenticatedSystem methods.

Should user\_controller\_test perform that require, so it doesn’t depend  
on  
the application? I think maybe it should…

Jay

---

<div class="post-metadata">

**Author:** ![jay-levitt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a88e57/32.png) [@jay-levitt](https://www.ruby-forum.com/u/jay-levitt)\
**Post date:** [August 18, 2006, 5:32pm UTC](https://www.ruby-forum.com/t/loginengine-usercontroller-fails-tests/65437/3 "2006-08-18T17:32:48Z")

</div>

Hi Jay,

Do you have any other engines installed?  
Please check against login\_engine/branches/rb\_1.0.

If there is still a problem, then please file a bug:  
[http://dev.rails-engines.org/](http://dev.rails-engines.org/)

Thanks.  
Jon
