Skip to content

Commit 1c09c29

Browse files
committed
register spec subclasses for people who spec
1 parent b15d2c0 commit 1c09c29

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

actionpack/lib/action_controller/test_case.rb

+6
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,12 @@ def exists?
326326
#
327327
# assert_redirected_to page_url(:title => 'foo')
328328
class TestCase < ActiveSupport::TestCase
329+
330+
# Use AS::TestCase for the base class when describing a model
331+
register_spec_type(self) do |desc|
332+
desc < ActionController::Base
333+
end
334+
329335
module Behavior
330336
extend ActiveSupport::Concern
331337
include ActionDispatch::TestProcess

activesupport/lib/active_support/test_case.rb

+7-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@
99
require 'active_support/core_ext/kernel/reporting'
1010

1111
module ActiveSupport
12-
class TestCase < ::MiniTest::Unit::TestCase
12+
class TestCase < ::MiniTest::Spec
13+
14+
# Use AS::TestCase for the base class when describing a model
15+
register_spec_type(self) do |desc|
16+
desc < ActiveRecord::Model
17+
end
18+
1319
Assertion = MiniTest::Assertion
1420
alias_method :method_name, :name if method_defined? :name
1521
alias_method :method_name, :__name__ if method_defined? :__name__

0 commit comments

Comments
 (0)