Is there a fixture I can use in my functional tests to handle the fact that you need to login? Since I''ve installed it, my functional tests all fail as the tests assume they can access the pages directly. I can write it myself if needed, I just wondered if I was missing something obvious (highly probable!) -- sam http://www.magpiebrain.com/
I usually have a series of very simple tests that involve requesting the page and checking for a redirect. If your system isn''t requiring a login, it will count as a successful request. This is assuming you''re using the login generator which redirects to login pages as needed. rick On 5/9/05, Sam Newman <sam.newman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Is there a fixture I can use in my functional tests to handle the fact > that you need to login? Since I''ve installed it, my functional tests > all fail as the tests assume they can access the pages directly. I can > write it myself if needed, I just wondered if I was missing something > obvious (highly probable!) > > -- > sam > http://www.magpiebrain.com/ > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- rick http://techno-weenie.net
Sam, no there isn''t. But, it should be easy enough to just do a POST with the login parameters, and you should be able to do it once in test_setup. Take a look at the functional test for the login generator, and you swipe the one or two liner for the login during test. On May 9, 2005, at 2:50 PM, Sam Newman wrote:> Is there a fixture I can use in my functional tests to handle the fact > that you need to login? Since I''ve installed it, my functional tests > all fail as the tests assume they can access the pages directly. I can > write it myself if needed, I just wondered if I was missing something > obvious (highly probable!) > > -- > sam > http://www.magpiebrain.com/ > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >