Skip to content

Instantly share code, notes, and snippets.

@diegobarros0701
Last active June 17, 2020 03:24
Show Gist options
  • Save diegobarros0701/36c8c665a298d4b96da0aa642652e95b to your computer and use it in GitHub Desktop.
Save diegobarros0701/36c8c665a298d4b96da0aa642652e95b to your computer and use it in GitHub Desktop.
Initial configurations for Rails RSpec

Add to the Gemfile

gem 'rspec-rails', '~> 3.9'

Run

rails generate rspec:install

Add to application.rb

config.generators do |generator|
  generator.test_framework :rspec,
    fixtures: false,
    view_specs: false,
    helper_specs: false,
    routing_specs: false
end

Now, optional settings

For format rspec output add to the .spec file

--format documentation

For generate binstub for RSpec

gem 'spring-commands-rspec'
bundle exec spring binstub --all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment