On 2 May 2011 14:30, Hans <[email protected]> wrote: > Thanks for your advise > > I will follow them > However, I am thinking of limiting myself mostly to functional test > (testing controllers). > Is that ok ?
You should certainly have unit tests for any logic in the models. > > Your suggestions with source control an testdriven development implies > that I should make a new rails 3 application copying source from my > old application needed for each test then refactoring and enhancing > the code. > Is that correct or should I still try to upgrade the whole > application. That is not what I meant, I would just upgrade in place after getting all the tests working. Initially it may not run at all so fix it a bit at a time, committing to the VCS after every improvement, then keep going till it passes all the tests. A key point about a VCS in this situation is that if you realise later that one of the 'fixes' was actually a mistake then it is easy to determine exactly what you changed and change it back again. I would suggest initially you only do what is necessary to get it working on Rails 3 and pass all the tests before starting any refactoring, rather than mix up refactoring and upgrading. Colin > > On 2 Maj, 12:06, Colin Law <[email protected]> wrote: >> On 2 May 2011 10:06, Hans <[email protected]> wrote: >> >> >> >> > I have a rather large application in rails 2.3.6 (about 40 controllers >> > and 20 plugins) with a working version in 2.3.11 >> > I am planing to upgrade to rails 3 and at the same time upgrading to >> > html5, css3 and to jquery >> >> > My question is the following >> >> > Should I try to upgrade the existing application as described in e.g >> > the book Raisl 3 upgrade handbook, rafactoring all of it ?? >> >> > Or should I Generate a new Rails 3 application copying the code action >> > for action method for method from the old application at the same time >> > as I am refactoring the copied parts ??? >> >> > Any-one that had the same problem ? >> > Any experiencies of these approaches ? >> > Which one should I use, considering that I have not implemented any >> > tests ? (Will do that at the same time) >> >> First I assume you are using a source control system (git for >> example). If not then start with that. >> Then I suggest writing tests before making any changes, otherwise you >> will not be confident all is working. Then upgrade to rails 3 only >> changing what needs to be changed to make it work (ie passing tests). >> Then proceed with enhancements and re-factoring. >> >> Colin > > -- > 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. > > -- 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.

