Sha256: 510957ff1d91cd805205f3ce21239a168afbc942b7d23ceeb3cfd5e2067ffc3b

Contents?: true

Size: 994 Bytes

Versions: 1

Compression:

Stored size: 994 Bytes

Contents

if defined?(ActiveSupport::TestCase)
  class << ActiveSupport::TestCase
    remove_method :describe
  end

  MiniTest::Spec.register_spec_type ActiveSupport::TestCase do |desc|
    desc.respond_to?(:ancestors) && !(desc.ancestors.map(&:to_s) & ["ActiveRecord::Base", "Mongoid::Document", "MongoMapper::Document", "DataMapper::Resource"]).empty?
  end
end

if defined?(ActionController::TestCase)
  class ActionController::TestCase
    def self.determine_default_controller_class(name)
      if name.match(/.*(?:^|::)(\w+Controller)/)
        $1.safe_constantize
      else
        super(name)
      end
    end

    before { setup_controller_request_and_response }
  end

  MiniTest::Spec.register_spec_type /Controller/, ActionController::TestCase
end

if defined?(ActionController::IntegrationTest)
  class ActionController::IntegrationTest
    before { self.class.app = Rails.application }
  end

  MiniTest::Spec.register_spec_type /Integration Test$/, ActionController::IntegrationTest
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
minitest-spec-rails-3.0.5 lib/minitest-spec-rails/test_case.rb