I have a resource where the new action requires a user to be logged in to view. If a user tries to create a new resource without being logged in, they are redirected (302'd) to the login page. My functional test looks like this:
test "should not get new unless logged in" do
get :new
assert_response :redirect
end
The stacktrace looks something like this:
ArgumentError: uncaught throw :warden
/.../gems/warden-1.1.1/lib/warden/proxy.rb:114:in `throw'
/.../gems/ruby-1.9.2-p318/gems/warden-1.1.1/lib/warden/proxy.rb:114:in `authenticate!'
/.../gems/ruby-1.9.2-p318/gems/devise-2.0.4/lib/devise/controllers/helpers.rb:48:in `authenticate_user!'
I have a before_filter to authenticate_user before the new action.
I understand why authenticate_user! is failing but I can't understand why its throwing an error. Shouldn't it just behave as it does in the webapp ie. redirects user to the log in page?
Thanks.
js: true
in the feature declaration (which I did not need, and was somehow causing this error) – Simdars