dimanche 4 octobre 2015

Rails 4 generates test database

I am using Rails 4.2.3 with sqlite. I have a simple 'assert true' unit test, using the built in ActiveSupport::TestCase.

There is one migration in db/migrate.

I am not sure why the following causes tests to run successfully, I expect to get a 'pending migrations' error:

rwc $ rake db:drop:all
rwc $ rake db:migrate:status
Schema migrations table does not exist yet.
rwc $ rake db:migrate:status RAILS_ENV=test
Schema migrations table does not exist yet.
rwc $ rake test
Run options: --seed 43484

# Running:

.

Finished in 0.011646s, 85.8671 runs/s, 85.8671 assertions/s.

1 runs, 1 assertions, 0 failures, 0 errors, 0 skips

The test is not interacting with the database, still I expected there to be an error due to migrations that have not been applied.

Can anyone explain this behaviour?

Aucun commentaire:

Enregistrer un commentaire