Note: you want to do include -T when you first run rails new
-
add the following to your Gemfile:
group :development do gem 'guard-rspec', require: false end
group :test do gem 'capybara' gem 'launchy' end
group :development, :test do gem 'rspec-rails' gem 'factory_girl_rails', '~> 4.0' end
-
rails g rspec:install -
add the following at the top of your
rails_helper.rbfile:require 'factory_girl_railsrequire 'capybara/rails'config.include FactoryGirl::Syntax::Methods end``` -
at the top of each spec file, include
require 'rails_helper' -
add
--format documentationto the .rspec file -
start testing!