Last active
July 26, 2017 07:08
-
-
Save radxene/2d0b231b020489dce0df57130e6caf5d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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