Unit Tests helps with migration too

This was a pleasant work, migration from ruby 1.9.3 + rails 3.2.13 to ruby 2.1.1 + rails 4.1.0. It took me few afternoons, and this is more or less how I did it:

  • switched ruby version to 2.0.0 (this was the latest available on my server) and ran tests, fixed whatever wasn’t working (meaning mostly upgrading gems to versions compatible with new ruby)
  • changed ruby version to 4.1.0 (here most work was needed), but basically I was just running tests and fixing what was not working
    • some config changes (as suggested here)
    • stage 1 – fix errors (2 times 2 hours)
    • stage 2 – fix fails (2x1hr)
  • in the meantime I asked my admin if 2.1.1 would be possible anytime soon. And in few days it was there. So I switched from 2.0 to 2.1.1 – without experiencing any new bugs (phew)
  • last stage was to try basic workflow test with capybara. This is where I’ve found the only bug not covered by my tests. It was due to change of HTTP method from PUT to PATCH.

Here’s a glimpse of the diff



Not much, huh? For a migration + introduction of capybara feature tests. I wish PHP frameworks I use would work like some day ;)

Share Button

One thought on “Unit Tests helps with migration too

  1. Pingback: Want to reuse variable and not pollute scope? Meet Object#tap() | webbricks

Leave a Reply

Your email address will not be published. Required fields are marked *