Closed AlexVangelov closed 10 years ago
What's the actual object the widget#parent_controller
is refering to? nil
?
No it is kind of ActionController::Base with #controller_path == 'barn'
I think it comes from Cell::TestCase, where it is overwrited in def setup @controller = Class.new(ActionController::Base).new
That's right, overriding this module (Cell::TestCase::CommonTestMethods#setup), adding if @controller.nil? to setter makes everything as I expected. BR!
So, do we have a problem, @AlexVangelov , @apotonick ?
Actually Yes. But the problem is not in this repository. It's related to https://github.com/apotonick/cells Setup in Cell::TestCase should not overwrite @controller (and may be @request, there is a practice to modify request in TestCase setup, like http basic authentication ). I think that setup should check @controller for existence and kind of ActionController::Base, and if it's OK to pass it untouched.
Agreed! PR?
Expecting parent_controller in Apotomo::Widget instance to be thе same as @controller assigned in Apotomo::TestCase. Delegates to parrent_controller breaks tests.