Skip to content

Instantly share code, notes, and snippets.

@cfcosta
Created March 19, 2012 19:05
Show Gist options
  • Save cfcosta/2124269 to your computer and use it in GitHub Desktop.
Save cfcosta/2124269 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