“rake spec” migrates the database every time

前端 未结 3 1774
北荒
北荒 2021-01-26 11:10

When I run any of the rspec tasks via rake, the database seems to be dropped and migrated, but if I run them via script/spec path/to/spec, it doesn\'t. Is there an option I can

3条回答
  •  Happy的楠姐
    2021-01-26 11:29

    It shouldn't be running any migrations, only importing db/schema.rb into your test database. This is the expected behavior so your tests use a fresh copy of the database schema before they run. What is your reasoning for not wanting it to refresh the test database?

提交回复
热议问题