Hello, I''m creating some functional tests form my controler, and most actions require login. I''m using login engine to manage the login functionalities. I would like to know how can I login a user in a functional test. This is, the first thing that I would like to do is to login a user. This way the response will return :success instead of :redirect. Thanks in advance. -- Posted via http://www.ruby-forum.com/.
Hi Gama, This has been covered many times in various mailing lists - hopefully Google can help you out with the specifics, but the gist of it is that you need to put a User in your tests'' sessions, so it appears that someone is logged in. - james On 7/3/06, Gama Franco <gama.franco@gmail.com> wrote:> Hello, > > I''m creating some functional tests form my controler, and most actions > require > login. I''m using login engine to manage the login functionalities. > > I would like to know how can I login a user in a functional test. This > is, the first thing that I would like to do is to login a user. This way > the response will return :success instead of :redirect. > > Thanks in advance. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- * J * ~
Hi Jame, You are right. After a few searches I found the answer in here: http://groups.google.pt/group/rails_archive/browse_thread/thread/ffa756b0d947ece8/6c9a05c4c8d7b13b?lnk=st&q=login+engine++test&rnum=1&hl=pt-PT#6c9a05c4c8d7b13b Thank you. James Adam wrote:> Hi Gama, > > This has been covered many times in various mailing lists - hopefully > Google can help you out with the specifics, but the gist of it is that > you need to put a User in your tests'' sessions, so it appears that > someone is logged in. > > - james-- Posted via http://www.ruby-forum.com/.