Skip to content

Instantly share code, notes, and snippets.

@czj
Created March 8, 2012 20:25
Show Gist options
  • Save czj/2003198 to your computer and use it in GitHub Desktop.
Save czj/2003198 to your computer and use it in GitHub Desktop.
Sample TestHelper file to use with minitest+spork+shoulda+capybara
ENV["RAILS_ENV"] = "test"
require 'rubygems'
require 'spork'
#uncomment the following line to use spork with the debugger
#require 'spork/ext/ruby-debug'
Spork.prefork do
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
require 'shoulda/rails'
require "capybara/rails"
require 'minitest/mock'
Capybara.default_driver = :selenium
$:.unshift File.dirname(__FILE__)
end
Spork.each_run do
# This code will be run each time you run your specs.
end
class ActiveSupport::TestCase
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
#
# Note: You'll currently still have to declare fixtures explicitly in integration tests
# -- they do not yet inherit this setting
fixtures :all
# Add more helper methods to be used by all tests here...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment