Sha256: b62e9103b717def56e3b88711abeb72d319fd308a579d92f3bb8de4e83211b33

Contents?: true

Size: 982 Bytes

Versions: 1

Compression:

Stored size: 982 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?(ActionDispatch::IntegrationTest)
  class ActionDispatch::IntegrationTest
    before { self.app = Rails.application }
  end

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

Version data entries

1 entries across 1 versions & 1 rubygems

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