Skip to content

Instantly share code, notes, and snippets.

@bergerjac
Last active May 1, 2019 01:23

Revisions

  1. bergerjac revised this gist Jun 10, 2015. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions webmock.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    # Gemfile
    group :test do
    gem 'webmock'
    end

    # spec/support/external_services.rb
    require 'webmock/rspec'
    WebMock.disable_net_connect!(allow_localhost: true)
  2. bergerjac revised this gist May 20, 2015. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions spec_helper.rb
    Original file line number Diff line number Diff line change
    @@ -8,3 +8,7 @@
    /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
  3. bergerjac revised this gist Apr 22, 2015. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions spec_helper.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    # 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
  4. bergerjac revised this gist Apr 22, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion shell
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    # reset DB
    $ rake db:drop && rake db:create && rake db:reset && rake db:seed
    $ 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)'
  5. bergerjac revised this gist Apr 20, 2015. 1 changed file with 8 additions and 1 deletion.
    9 changes: 8 additions & 1 deletion shell
    Original file line number Diff line number Diff line change
    @@ -2,4 +2,11 @@
    $ rake db:drop && rake db:create && rake db:reset && rake db:seed

    # start server, suppressing most SQL log messages
    $ rails s | grep -v -E '(SELECT|BEGIN|COMMIT|Load|FROM|INSERT)'
    $ 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
  6. bergerjac revised this gist Apr 17, 2015. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion shell
    Original file line number Diff line number Diff line change
    @@ -1 +1,5 @@
    $ rake db:drop && rake db:create && rake db:reset && rake db:seed
    # reset DB
    $ rake db:drop && rake db:create && rake db:reset && rake db:seed

    # start server, suppressing most SQL log messages
    $ rails s | grep -v -E '(SELECT|BEGIN|COMMIT|Load|FROM|INSERT)'
  7. bergerjac created this gist Apr 15, 2015.
    1 change: 1 addition & 0 deletions shell
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    $ rake db:drop && rake db:create && rake db:reset && rake db:seed