Displaying 1 result from an estimated 1 matches for "test_redirect_not_authenticated_user".
2006 May 10
0
Ezra''s acl_system2 and flash not getting populated in functional tests
...x
   end
   ...
   protected
   def permission_denied
     flash[:message] = "You must log in as an administrator."
     redirect_to :controller => "account", :action => "login
   end
end
In the test:
ACTIONS = [:index, :new, :edit, :create, :update, :destroy]
def test_redirect_not_authenticated_user
   ACTIONS.each do |a|
     get a
     assert_redirected_to :controller => ''account'', :action => ''login''
   end
end
def test_redirect_not_admin
   assert not_admin = User.authenticate("not_admin", "her_password")
   ACTIONS.each do |a|...