rspec basics

When you create a new site, skip generating unit test, as you want to use rspec instead.

$ rails new sample_app --skip-test-unit

Add rspec to your gemfile

group :development, :test do
  gem 'sqlite3'
  gem 'rspec-rails', '2.9.0'
end

group :test do
  gem 'capybara', '1.1.2'
end

copybara gem allows you to interact with the app with a natual English-like syntaxt.

Then run bundle install to install those gems.

$ bundle install --without production

Configure your rails app to use rspec in place of test::unit.

$ rails generate rspec:install
rspec basics

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s