ここで、specの煩わしいディレクトリは消すのが慣習っぽい。
$ rails g scaffold article subject:string body:textinvoke mongo_mapper
create app/models/article.rb
invoke rspec
create spec/models/article_spec.rb
invoke factory_girl
create spec/factories/articles.rb
route resources :articles
invoke scaffold_controller
create app/controllers/articles_controller.rb
invoke erb
create app/views/articles
create app/views/articles/index.html.erb
create app/views/articles/edit.html.erb
create app/views/articles/show.html.erb
create app/views/articles/new.html.erb
create app/views/articles/_form.html.erb
invoke rspec
create spec/controllers/articles_controller_spec.rb
create spec/views/articles/edit.html.erb_spec.rb
create spec/views/articles/index.html.erb_spec.rb
create spec/views/articles/new.html.erb_spec.rb
create spec/views/articles/show.html.erb_spec.rb
invoke helper
create spec/helpers/articles_helper_spec.rb
create spec/routing/articles_routing_spec.rb
invoke helper
create app/helpers/articles_helper.rb
invoke rspec
invoke assets
invoke coffee
create app/assets/javascripts/articles.js.coffee
invoke scss
create app/assets/stylesheets/articles.css.scss
invoke scss
create app/assets/stylesheets/scaffolds.css.scss
$ rm -rf spec/views
$ rm -rf spec/helpers
RSpecの書き方は慣れていかないと。。後で読む↓
http://jp.rubyist.net/magazine/?0021-Rspec
http://d.hatena.ne.jp/keisukefukuda/20080124/p1
Scaffoldで土台作ってテスト実行したら、失敗してた。軽く修正。
assigns(:articles).should eq([article])
↓
assigns(:articles)[-1].should eq(article)response.should redirect_to(Article.last)
↓
response.should redirect_to(assigns(:article))