【发布时间】:2012-06-16 16:53:06
【问题描述】:
我之前使用的是 Mysql 数据库并决定切换到 Postgresql,现在,当我使用 rspec 运行测试时,我收到了很多警告和通知。
WARNING: there is already a transaction in progress
NOTICE: there is no transaction in progress
should has link "Suspender"
WARNING: there is already a transaction in progress
NOTICE: there is no transaction in progress
should has css "title" with text "Suspensão de anúncio"
WARNING: there is already a transaction in progress
NOTICE: there is no transaction in progress
should has css "h1" with text "Awesome job!"
我怎样才能抑制它?有没有办法对吧?
【问题讨论】:
-
你是用标志
--format progress调用它吗?也许在你的 .rspec 文件中? -
不,我的 .rspec 文件中只有
--colour、--drb和--format d。 -
请参阅:github.com/rspec/rspec-rails/issues/58 并考虑按照问题中的建议使用 DB 清理器。
-
您是否将:
config.use_transactional_examples = true设置为 false 并查看是否会破坏任何内容? -
哦,设置
config.use_transaction_fixtures = false会停止警告和通知。谢谢。
标签: ruby-on-rails-3 postgresql rspec2 rails-postgresql