Last active
May 1, 2019 01:23
-
-
Save bergerjac/8a1579c58a0e82c235e8 to your computer and use it in GitHub Desktop.
rails
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
# reset DB | |
$ rake db:drop db:create db:migrate | |
# start server, suppressing most SQL log messages | |
$ rails s | grep -v -E '(SELECT|BEGIN|COMMIT|Load|FROM|INSERT)' | |
# heroku DB provision | |
$ heroku config --app wundertest8 # show config | |
$ heroku addons:add heroku-postgresql:hobby-dev --app app | |
$ heroku pg:promote HEROKU_POSTGRESQL_COBALT_URL --app app | |
$ heroku addons:remove HEROKU_POSTGRESQL_GRAY_URL --app app | |
$ heroku run rake db:migrate --app app |
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
# rspec stacktrace, remove lines | |
RSpec.configure do |config| | |
config.backtrace_exclusion_patterns = [ | |
/\/lib\d*\/ruby\//, | |
/bin\//, | |
/gems/, | |
/spec\/spec_helper\.rb/, | |
/lib\/rspec\/(core|expectations|matchers|mocks)/ | |
] | |
end | |
# for those who favor convention over config.. | |
# $ nano spec/spec_helper_custom.rb | |
# $ rspec -r ./spec/spec_helper_custom.rb |
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
# Gemfile | |
group :test do | |
gem 'webmock' | |
end | |
# spec/support/external_services.rb | |
require 'webmock/rspec' | |
WebMock.disable_net_connect!(allow_localhost: true) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment