I get an error NameError (undefined local variable or method \"current_user\" for #): when I try to use current_user in a
NameError (undefined local variable or method \"current_user\" for #):
Building on ksol's post, you can ensure user.is_test by passing a block to authenticated:
authenticated :user, lambda {|u| u.is_test } do // route stuff here end
This is assuming that u.is_test returns a Boolean value.