rails3测试相关

rake db:create:all --建立test,development,product三个数据库
rake db:test:prepare --将development数据库表建到test数据库,这一步必须执行,不然执行rake test 会报表不存在错误。
ActiveRecord::StatementInvalid: Mysql::Error: Table 'depot_test.products' doesn't exist: DELETE FROM `products`
rake test  --集成测试
rake test:units --单元测试
rake test:functionals --功能测试

你可能感兴趣的:(mysql,单元测试,ActiveRecord)