I got this Ruby on Rails application with incomplete testing, (many controllers or views do not have unit test at all). Should I go back to write all unit test for each of controller or view, then do integration test? Or I just forget about all of them, keep going ahead with my new functions with my new unit test? My concerns here are: I also need to upgrade Ruby and Rails, or re- factoring the program. How can I test to make sure the whole application will be running just fine after all the upgrading and re- factoring? Thanks, Li
Marnen Laibow-Koser
2009-Oct-28 17:53 UTC
Re: What should I do testing for an old application?
Suki wrote:> I got this Ruby on Rails application with incomplete testing, (many > controllers or views do not have unit test at all). > > Should I go back to write all unit test for each of controller or > view, then do integration test? Or I just forget about all of them, > keep going ahead with my new functions with my new unit test? > > My concerns here are: I also need to upgrade Ruby and Rails, or re- > factoring the program. How can I test to make sure the whole > application will be running just fine after all the upgrading and re- > factoring?Write the tests *before* upgrading and refactoring. The tests will tell you if the changes break anything. That''s what they''re for! (BTW, integration tests are probably less useful than Cucumber features.)> > Thanks, > LiBest, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
Thank you very much! I was thinking about it, but afraid to waste too much of my time. Your response confirm my thinking. Great. I just go ahead do it. On Oct 28, 1:53 pm, Marnen Laibow-Koser <rails-mailing-l...@andreas- s.net> wrote:> Suki wrote: > > I got this Ruby on Rails application with incompletetesting, (many > > controllers or views do not have unit test at all). > > > Should I go back to write all unit test for each of controller or > > view, then do integration test? Or I just forget about all of them, > > keep going ahead with my new functions with my new unit test? > > > My concerns here are: I also need to upgrade Ruby and Rails, or re- > > factoring the program. How can I test to make sure the whole > > application will be running just fine after all the upgrading and re- > > factoring? > > Write the tests *before* upgrading and refactoring. The tests will tell > you if the changes break anything. That''s what they''re for! > > (BTW, integration tests are probably less useful than Cucumber > features.) > > > > > Thanks, > > Li > > Best, > -- > Marnen Laibow-Koserhttp://www.marnen.org > mar...-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > -- > Posted viahttp://www.ruby-forum.com/.
Maybe Matching Threads
- tips on how to write a controller test for models associated with currently logged in user
- Reinstantiate controller during functional testing
- Anything special needed to migrate test::unit tests from Rails 2x to Rails3?
- skinny Controllers, fat models with REST?
- has_many through , or habtm , using form