Register trainee teachers - Testing Data Migrations
Data migrations should be tested against production-like data.
- Deploy to
productiondata
- Check that the deployment ran successfully and the data migration happened
- Do any necessary checks on
productiondata
to ensure that the data has been changed as expected
RSpec tests
Where a migration has logic beyond looping a list and updating records, it is good practice to include a service within the migration and write a test for the service. An example is: