【发布时间】:2021-07-11 05:45:34
【问题描述】:
在单元或集成测试中,我需要能够使用内存中的 mongoDB 只是为了方便。我能做到吗?我尝试搜索解决方案,但没有关于如何编写 mongoid.yml 以在内存中使用的教程。
除此之外,我可以只在 mongoid.yml 中使用默认环境,而不是为开发和生产编写副本吗?就像搬家一样
development:
client:
...
production:
client:
...
进入
default: &default
client:
...
【问题讨论】:
标签: ruby-on-rails ruby mongodb mongoid rspec-rails