Skip to content

Instantly share code, notes, and snippets.

@wh1tney
Created August 13, 2014 18:36
Show Gist options
  • Save wh1tney/0a03c3a4974bbb70b9d8 to your computer and use it in GitHub Desktop.
Save wh1tney/0a03c3a4974bbb70b9d8 to your computer and use it in GitHub Desktop.
Rails Test Environment
require "minitest/autorun"
require "mocha/setup"
require 'simplecov'
require 'capybara/dsl'
require 'capybara/rails'
SimpleCov.start
module TestHelper
include Capybara::DSL
def setup
DatabaseCleaner.strategy = :truncation
DatabaseCleaner.clean_with(:truncation)
DatabaseCleaner.start
end
def teardown
DatabaseCleaner.clean
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment