As your application evolves your models change and so does your database. In Rails this is solved using migrations. If you aren’t familiar with the concept of migrations I would suggest you read the rails guides about migrations first.

Data migrations are just migrations that change data in the database.

How server rooms really look like

Testing data migrations

Consider the following migration. It concatenates the first and last name into just a name. Silly example but it demonstrates the purpose.

This is an extension of Alessandro Rodi’s Article about Catch Javascript errors in your system tests

Proper testing of a rails application includes system tests, which are meant to test the app as a complete entity, verify the functionality and find miscommunications between components.

By default rspec does not care about javascript errors so we have to configure it to do so. Previously we did this directly in the rails helper, which made it look a bit messy and is also quite annoying to do for every project.

Janis Leuenberger

Software Developer at Renuo AG

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store