Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@bergerjac
Last active May 1, 2019 01:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bergerjac/8a1579c58a0e82c235e8 to your computer and use it in GitHub Desktop.
Save bergerjac/8a1579c58a0e82c235e8 to your computer and use it in GitHub Desktop.
rails
# 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
# 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
# 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