Added checks for pending migrations before tests are run. (from Rails4)