Sorry guys, it was my test suite acting all funny (Test/Spec).
James H
On Nov 22, 11:55 pm, "James H." <james.herd...@gmail.com>
wrote:> Hey folks
>
> 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
>
> before_filter :login_required
>
> protected
>
> def authorized? # Called first by login_required.
> admin? # Let''s pretend we fail right here
> end
>
> # This _should_ be called as a result of authorized? failing.
It''s
> never called!
> # Instead, the original method in the mixin is called!
> def access_denied
> redirect_to some_sensible_url
> end
> end
>
> (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?
>
> James Herdman
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com
To unsubscribe from this group, send email to
rubyonrails-core-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---