Notes on using Pry and Tests

Some tips for using pry to experiment with test code:

Sandbox

Run this to get a sandbox test environment:

rails console --help
Usage: rails console [environment] [options]
    -s, --sandbox                    Rollback database modifications on exit.
    -e, --environment=name           Specifies the environment to run this console under (test/development/production).
                                     Default: development
        --debugger                   Enables the debugger.

Thus use this for testing:

rails console test --sandbox

Load helpers

You can run this and all your helpers are available

require "rails_helper"