From fc9c6c9468040e0bb85c643ba84807c41500724f Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Mon, 22 Dec 2014 15:31:50 +0100 Subject: [PATCH] document the return of `db:test:prepare`. Closes #18136. [ci skip] This is a doc follow-up to #17739. /cc @zzak --- guides/source/testing.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/guides/source/testing.md b/guides/source/testing.md index b4c70dfa1dbb5..a324139d1b484 100644 --- a/guides/source/testing.md +++ b/guides/source/testing.md @@ -221,7 +221,16 @@ Every test contains one or more assertions. Only when all the assertions are suc ### Maintaining the test database schema -In order to run your tests, your test database will need to have the current structure. The test helper checks whether your test database has any pending migrations. If so, it will try to load your `db/schema.rb` or `db/structure.sql` into the test database. If migrations are still pending, an error will be raised. +In order to run your tests, your test database will need to have the current +structure. The test helper checks whether your test database has any pending +migrations. If so, it will try to load your `db/schema.rb` or `db/structure.sql` +into the test database. If migrations are still pending, an error will be +raised. Usually this indicates that your schema is not fully migrated. Running +the migrations against the development database (`bin/rake db:migrate`) will +bring the schema up to date. + +NOTE: If existing migrations required modifications, the test database needs to +be rebuilt. This can be done by executing `bin/rake db:test:prepare`. ### Running Tests