黄瓜测试不删除数据
我有一个项目,其中黄瓜的几个功能(普通和硒)都失败,表明由于电子邮件唯一性验证而尝试创建用户时出现问题(因此记录不会被删除,并且该功能的每个背景都失败)
我收到警告像这样“警告:您已将 Rails 的 config.cache_classes 设置为 false(最有可能在 config/environments/cucumber.rb 中)。已知此设置会破坏 Cucumber 的 use_transactional_fixtures 方法。如果您想使用事务性,请将 config.cache_classes 设置为 true有关更多信息,请参阅 https://rspec.lighthouseapp.com/projects/16211/tickets /165。”
奇怪的是,我所有的环境都将 session_cache 设置为 true (只是开发将其设置为 false,但我也尝试将其设置为 true 并运行它)
同样的项目正在其他计算机上运行,我尝试卸载 ruby 以及来自 rvm 的所有 gem 和重新安装但我仍然遇到相同的错误
任何想法我还可以尝试在我的 mac 上解决这个问题吗?数据库清理策略也设置为固定装置,
感谢您的时间
I have a project with several features in cucumber both plain and selenium are failing indicating problems when trying to create a user because of the email uniqness validation (so the records are not being deleted and every background on the feature is failing)
I get a warning like this "WARNING: You have set Rails' config.cache_classes to false (most likely in config/environments/cucumber.rb). This setting is known to break Cucumber's use_transactional_fixtures method. Set config.cache_classes to true if you want to use transactional fixtures. For more information see https://rspec.lighthouseapp.com/projects/16211/tickets/165."
Weird enough all my enviroments have the session_cache set to true (just development hast it on false but I also tried setting it to true and run it)
Also the same project is working on other computers I tried uninstaling ruby and all the gems from rvm and reinstall but I still get the same error
Any ideas what else i could try to solve this on my mac? also database cleaning strategy is set to fixtures
I appreciate your time
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我会尝试使用钩子来清除数据。
https://github.com/cucumber/cucumber/wiki/Hooks
之前的钩子将对所有记录执行 .destroy 以确保干净的开始可能是一个不错的选择。我觉得这很奇怪,但可能会帮助您进一步诊断故障。
I would try using a hook to clear out the data.
https://github.com/cucumber/cucumber/wiki/Hooks
A before hook that will do a .destroy on all records to ensure a clean start may be a good bet. It feels hacky to me, but may help you further diagnose the failure.