spec DSL, Minitest::Spec . Rails ActiveSupport::TestCase , , ActionController::TestCase. - DSL ActionSupport::TestCase .
, ActiveSupport::TestCase DSL. , test_helper.rb:
class ActiveSupport::TestCase
# Add spec DSL
extend Minitest::Spec::DSL
end
( , ActiveSupport::TestCase.describe ? , , DSL, .)
-, spec DSL ActiveSupport::TestCase. DSL register_spec_type . test_helper.rb:
class ActiveSupport::TestCase
# Use AS::TestCase for the base class when describing a model
register_spec_type(self) do |desc|
desc < ActiveRecord::Base if desc.is_a?(Class)
end
end
, ActiveRecord, ActiveSupport::TestCase Minitest::Spec .
, DSL . - minitest-rails, require "minitest/rails" test_helper.rb. minitest-rails . ( .)
. blaurgh Minitest Spec Rails 4. </- >