使用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>'
解决方法
这可以通过运行来解决:
bundle exec rake db:test:prepare