使用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>'
答案 0 :(得分:14)
这可以通过运行:
来解决bundle exec rake db:test:prepare