前回の記事 で書いたdefault_scopeとunscopedの例を試すために、簡単な本棚アプリを作ってみた。 環境 rails 3.0.7 rspec 2.6.0 rspec-rails 2.6.1 rails new 本棚アプリを作る rails new bookshelf -Tテストはrspec使いたいので、-Tオプションを指定する。 git init gitリポジトリを作って、コミットしておく。 cd bookshelf git init git add . git commit -m "project init" rspecとfactory_girlの設定をする Gemfileの:development, :testのグループにgemを追加する。 railsが生成したGemfileのコメントを外して、下記の内容を追加する。 group :development, :test d