Skip to content

Instantly share code, notes, and snippets.

@joselo
Forked from cfcosta/gist:2124269
Created April 13, 2012 03:08
Show Gist options
  • Save joselo/2373301 to your computer and use it in GitHub Desktop.
Save joselo/2373301 to your computer and use it in GitHub Desktop.
integration test helper for rails with minitest
ENV['RAILS_ENV'] = "test"
unless defined?(Bundler)
require 'bundler/setup'
end
require 'minitest/autorun'
require 'factory_girl'
MiniTest::Unit::TestCase.send(:include, FactoryGirl::Syntax::Methods)
require File.expand_path('../../config/environment', __FILE__)
require 'active_support/test_case'
require 'action_controller/test_case'
require 'action_dispatch/testing/integration'
require 'capybara/rails'
class MiniTest::Unit::TestCase
def setup
@routes = Rails.application.routes
end
include ActiveSupport::Testing::SetupAndTeardown
include ActionDispatch::Assertions
include ActionController::TestCase::Behavior
include Capybara::DSL
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment