Class: ActionController::TestCase

Inherits:
Object
  • Object
show all
Defined in:
lib/minitest/rails/expectations.rb,
lib/minitest/rails/assertions.rb,
lib/minitest/rails/assertions.rb,
lib/minitest/rails/assertions.rb,
lib/minitest/rails.rb

Overview

Not real expectations, just aliases The error messages don't get messed up this way

Class Method Summary collapse

Class Method Details

.determine_default_controller_class(name) ⇒ Object

Resolve the controller from the test name when using the spec DSL

Raises:

  • (NameError)

52
53
54
55
56
57
58
# File 'lib/minitest/rails.rb', line 52

def self.determine_default_controller_class(name)
  controller = determine_constant_from_test_name(name) do |constant|
    Class === constant && constant < ActionController::Metal
  end
  raise NameError.new("Unable to resolve controller for #{name}") if controller.nil?
  controller
end