Project

General

Profile

Actions

Refactor #13039

closed

Remove DB queries from class of UnattendedController

Added by Dominic Cleal almost 9 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Rails
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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.


Related issues 3 (0 open3 closed)

Related to Foreman - Refactor #13409: Remove maintain_test_schema! Rails initializerClosedDominic Cleal01/27/2016Actions
Related to Foreman - Bug #15490: CVE-2016-4995 - view_hosts permissions/filters not checked for provisioning template previewsClosedLukas Zapletal06/22/2016Actions
Related to Foreman - Bug #10689: Unattended controller permission check does not workDuplicateLukas Zapletal06/03/2015Actions
Actions #1

Updated by The Foreman Bot almost 9 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3029 added
Actions #2

Updated by Dominic Cleal almost 9 years ago

  • Translation missing: en.field_release set to 71
Actions #3

Updated by Dominic Cleal almost 9 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #4

Updated by Dominic Cleal almost 9 years ago

  • Related to Refactor #13409: Remove maintain_test_schema! Rails initializer added
Actions #5

Updated by Dominic Cleal over 8 years ago

  • Related to Bug #15490: CVE-2016-4995 - view_hosts permissions/filters not checked for provisioning template previews added
Actions #6

Updated by Dominic Cleal over 8 years ago

  • Related to Bug #10689: Unattended controller permission check does not work added
Actions #7

Updated by Bryan Kearney over 8 years ago

  • Bugzilla link set to 1201676
Actions

Also available in: Atom PDF