rspec测试使用常规数据库而不是测试数据库 [英] rspec test using regular database not test database
问题描述
我使用 Rspec、webrat、selenium rc 进行测试.
I am using Rspec, webrat, selenium rc for tests.
我正在尝试使用 selenium 和 rspec 进行集成测试.
I am trying to do integration test with selenium and rspec.
我刚刚查看了我的开发数据库,了解到我的集成测试使用的是我的开发数据库,而不是我的测试数据库.
I just looked in my development database and learned that my integration tests are using my development database and not my test database.
我如何配置 rails、rspec 和 selenium 以使用我的测试数据库.
How an I configure rails and rspec and selenium to use my test database.
我所有的其他测试似乎都在使用我的测试数据库.
All my other tests seem to be using my test database.
推荐答案
你有没有像这样的一行
ENV["RAILS_ENV"] ||= 'test'
在您的 spec_helper.rb 中?如果添加/替换为
in your spec_helper.rb? does it force the use of the test db if you add/replace it with
ENV["RAILS_ENV"] = 'test'
这可能是您昨天问题的根源 - 重新电子邮件验证吗??
And could this be the root of your problem from yesterday - re email validation??
这篇关于rspec测试使用常规数据库而不是测试数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!