如何根据我的开发数据库生成夹具? [英] How to generate fixtures based on my development database?

查看:29
本文介绍了如何根据我的开发数据库生成夹具?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很懒,因为我的生产数据库有我可以用来测试和开发的数据,我想知道是否有任何简单生成装置的方法.

I'm lazy and I since my production database has data I could use for testing through on going development, I was wondering if there were any easy methods of generating fixtures.

在 1.8.7 上使用 Rails 3

Using Rails 3 on 1.8.7

推荐答案

你真的可以谷歌这个.rails 从数据库创建夹具".第一次点击:http://snippets.dzone.com/posts/show/2525.但是你会产生我认为会是脆弱的测试.考虑使用夹具更换.像 Fixjour工厂女孩,或机械师.他们将帮助您思考您在代码中抛出什么样的边缘情况.只是一个想法.

You really can Google this. "rails create fixture from database". First hit: http://snippets.dzone.com/posts/show/2525. But you will be generating what I think will be brittle tests. Consider using fixture replacements. Like Fixjour, Factory Girl, or Machinist. They will help you think about what kind of edge cases you are throwing at your code. Just a thought.

这篇关于如何根据我的开发数据库生成夹具?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆