Hi
   Once I have answered this

Suppose if you are using a session varible person_id it can be done like 
for example in test_helper just write a def like

def login_as(person)
      @request.session[:person_id] = person ? person.id : nil
end

And from your test call this by passing administrator  object as
variable


def test_should_get_index
  login_as(your_person_object_here)
  get :index
  assert_response :success
end




Sijo
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to