plataformatec/devise — Issue #1670: Writing specs for routes defined with authenticated
Author: rafael
Created: 2012-02-20 19:08:18+00:00
State: open

Greetings,

I'm trying to use the method "authenticated" when defining a route only for authenticated users and is working. I'm having something like this in my routes:

authenticated :users do
resources :client-leads, :controller => 'authenticated/coach_match_leads'
end

However, I'm trying to write test for these routes and is not working. The test is the following:

{:get => "/client-leads"}.should route_to("authenticated/coach_match_leads#index")

But I'm getting I'm exception:

NoMethodError Exception: undefined method `authenticate?' for nil:NilClass

Do you have any ideas why is this happening? Is important to notice that this is happening only for the routes defined with authenticated. All the other specs for the routes are working properly (even the ones for other devise routes).

Thanks in advanced for your help.