Skip to content

Instantly share code, notes, and snippets.

@radxene
Last active July 26, 2017 07:08
Show Gist options
  • Save radxene/2d0b231b020489dce0df57130e6caf5d to your computer and use it in GitHub Desktop.
Save radxene/2d0b231b020489dce0df57130e6caf5d to your computer and use it in GitHub Desktop.
## Add in Gemfile
group :development, :test do
# ...
gem 'rspec-rails'
gem 'factory_girl_rails'
end
group :test do
gem 'shoulda-matchers', '~> 3.0'
end
=begin
## Run in terminal
rm -rf test/
bundle install
rails generate rspec:install
=end
## Add in rails_helper.rb
Shoulda::Matchers.configure do |config|
config.integrate do |with|
## Choose a test framework:
with.test_framework :rspec
# with.test_framework :minitest
# with.test_framework :minitest_4
# with.test_framework :test_unit
## Choose one or more libraries:
# with.library :active_record
# with.library :active_model
# with.library :action_controller
## Or, choose the following (which implies all of the above):
with.library :rails
end
end
## And add option in .rspec for beautiful output
--format doc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment