Skip to content
Chris Jones edited this page Dec 7, 2018 · 3 revisions

Notes

  • RSpec isn’t included in a default rails application.

To setup rspec and friends 👫 to work a bundled ruby application add the below gems to the project's Gemfile

group :development, :test do
  gem “rspec-rails”, ~> 3.1.0
  gem “factory_girl_rails”, ~> 4.4.1
end

group :test do
  gem “faker”, ~> 1.4.3
  gem “capybara”, ~> 2.4.3
  gem “database_cleaner”, ~> 1.3.0
  gem “launchy”, ~> 2.4.2
  gem “selenium-webdriver”, ~> 2.43.0
end

To install rspec within the bundled project

rails generate rspec:install

To test connectivity with the databases set-up in the config/database.yml run the below rake task.

bin/rake db:create:all

RSpec Configuration

The below command will setup rspec within a rails application / project

rails g rspec:install

To run the current tests in the test suite

rspec spec

To install the binstubs for Rspec

bundle binstubs rspec-core
Clone this wiki locally