I'm trying to track down the source of some weirdness with a
namespaced controller. I'm using Rick's RESTful Authentication
plugin. In this plugin you can override two methods to customize how
to ascertain authorized users and how to react to unauthorized users.
This is via a mixin residing in your lib directory, which is usually
included in ApplicationController.
Suppose you have a controller like...
class Admin::UsersController < ApplicationController
def authorized? # Called first by login_required.
admin? # Let's pretend we fail right here
# This _should_ be called as a result of authorized? failing. It's
# Instead, the original method in the mixin is called!
(Pastie'd here if the above is garbled: http://pastie.caboo.se/121108)
As noted in the comments, I'm finding the access_denied method defined
in the mixin is being called instead of that in my controller ONLY
when I run "rake test:functionals", not when I run individual tests.
Have I lost my mind, or is some weird name-spacing stuff happening?