Actions
Refactor #13039
closedRemove DB queries from class of UnattendedController
Difficulty:
Triaged:
Bugzilla link:
Pull request:
Description
UnattendedController makes DB queries for TemplateKinds in the class scope to define methods and set up action filters. This bad style causes a problem in foreman_bootdisk which adds a method chain to the provision method in the class. When running tests under Rails 4, if the controller's instantiated too early, the right methods aren't defined.
4) Error: UnattendedControllerTest#test_0002_should get a kickstart even if not using the first NIC: AbstractController::ActionNotFound: The action 'provision' could not be found for UnattendedController test/functional/unattended_controller_test.rb:43:in `block in <class:UnattendedControllerTest>'
Changing this to make queries when it's called would create more testable code both in core and the plugin.
Actions