9

使用 Rails 3.1.x、DatabaseCleaner gem 和 capybara 2,我在尝试运行测试时得到以下信息:

 Failure/Error: Unable to find matching line from backtrace
 ActiveRecord::StatementInvalid:
   Mysql2::Error: Table 'teambox_test_default.incoming_emails' doesn't exist: TRUNCATE TABLE incoming_emails
 # ./config/initializers/connection_fix.rb:24:in `execute'
 # -e:1:in `<main>'
4

1 回答 1

14

这可以通过运行解决:

bundle exec rake db:test:prepare
于 2013-01-04T15:28:53.917 回答