Created
March 19, 2012 19:05
-
-
Save cfcosta/2124269 to your computer and use it in GitHub Desktop.
integration test helper for rails with minitest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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