Rails 可以根据当前模式重新创建默认单元测试和固定装置文件吗?
是否有一个脚手架或其他命令可以根据当前模式从头生成测试/装置和测试/单元文件?
Rails 3.0.3 应用程序还没有单元测试或固定装置,但已经对多个表进行了多次迁移,并且具有相当多的字段。因此,不久前创建的 test/fixtures 和 test/unit 中的默认文件已经过时了。我可以重新运行一些脚手架命令,而不是根据架构手动重新创建它们吗?
(我发现rails生成integration_test但没有看到任何重新创建测试/单元和测试/装置的内容。)
Is there a scaffold or other command that will generate from scratch the test/fixtures and test/unit files based upon the current schema?
A rails 3.0.3 app has no unit tests or fixtures yet, but has been through several migrations for several tables and have quite a few fields. So the default files in test/fixtures and test/unit that were created some time ago are very much out of date. Rather than re-created them manually based on the schema, can I re-run some scaffold command?
(I found rails generate integration_test
but didn't see anything to re-create the test/unit and test/fixtures.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过查看当前代码在 Rails 上,没有。
编辑:这类似于 这个问题。
我还推荐类似 FactoryGirl 的东西,而不是固定装置。
By looking at the current code on Rails, no.
Edit: This is similar to this question.
I also recommend something like FactoryGirl instead of fixtures.