RSpec / RSpec Rails / Docs
Getting started
Install Rails-3
$ gem install rails -v "~> 3.0.0"Generate an app
$ rails new example
$ cd exampleAdd rspec-rails to the Gemfile
$ echo 'gem "rspec-rails", :group => [:development, :test]' >> GemfileInstall the bundle
$ bundle installGenerate a scaffold
$ rails generate scaffold Widgets name:stringThis generates files in the app and spec directories. The files in the app directory are generated by Rails, and Rails delegates the generation of the files in the spec directory to RSpec.
Run migrations
$ rake db:migrate && rake db:test:prepareRun RSpec
$ rake specor
$ rspec specIf all went well, you should see output ending with:
29 examples, 0 failures, 2 pendingSource: features/GettingStarted.md at v2.4.1, RSpec Rails (MIT license).