i was wondering why i was getting the following message -
"Unable to determine the controller to test from
ServiceControllerTest. You'll need to specify it using 'tests
YourController' in your test case definition"
after trying several times, i found my "ServiceController" had
initialization error as i had included wrong method name. though to
coming up with this conclusion i had to add "puts $!" to
ActionController::TestCase.
def determine_default_controller_class(name)
name.sub(/Test$/, '').constantize
rescue NameError
puts "Error #{$!}"
raise NonInferrableControllerError.new(name)
end
i think there should have a patch where it clearly mention about the
original error message.
best wishes,
i was wondering why i was getting the following message -
"Unable to determine the controller to test from
ServiceControllerTest. You'll need to specify it using 'tests
YourController' in your test case definition"
I've changed the error message a little in:
http://dev.rubyonrails.org/changeset/8749
Hopefully this makes it a little easier to track down.
hi,
thanks for your latest patch, it is better than before.
anyway, i was thinking isn't that better if it could have the original
error message.
let's say -
def determine_default_controller_class(name)
name.sub(/Test$/, '').constantize
rescue NameError
raise NonInferrableControllerError.new(name, $!) # pretending
their is an update with the constructor with an optional message
field.
end
class NonInferrableControllerError
def initialize(p_name, p_message)
# ....
end
end
best wishes,