---
title: "rspec"
author: "yangbinfc"
date: "2011-03-18T13:46:00Z"
tags: []
slug: "rspec"
draft: false
lastmod: "2012-11-04T17:47:31Z"
id: 1715340
url: "https://yangbinfc.iteye.com/blog/1715340"
---

使用rspec\_scaffold 代替 scaffold\_resource

rails rspec\_scaffold post title:string body:text author:integer created\_at:datetime updated\_at:datetime  
rails3: rails g rspec:install rails g scaffold  
会生成：model controller helper views

spec/models/post\_spec.rb

rspec 到需要到rspec目录下才可以