Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails7 test fixes #9231

Merged
merged 3 commits into from
Aug 6, 2024
Merged

Rails7 test fixes #9231

merged 3 commits into from
Aug 6, 2024

Commits on Aug 2, 2024

  1. Ownership class for controller parameter should be VmOrTemplate

    It's was unclear at first why we don't hit this in rails 6.1
    because on rails 7, we get VmOrTemplate as I would expect from this code:
    https://github.com/ManageIQ/manageiq-ui-classic/blob/9761b105b3a0038f30c1b933c24bee99ea3daf0b/app/controllers/mixins/actions/vm_actions/ownership.rb#L71-L86
    
    Keenan made the following findings:
    
    This calls post 2 times: explorer and x_button.
    In the explorer call, the db/model is ManageIQ::Providers::CloudManager::Vm
    In the x_button the db/model is VmOrTemplate.
    
    The explorer call sets the report_data_additional_options.model to the current model,
    which is ManageIQ::Providers::CloudManager::Vm.
    
    The x_button call will reuse the report_data_additional_options.model value if it is present.
    
    In 6.1, the x_button has the instance variable set, so the model is ManageIQ::Providers::CloudManager::Vm
    In 7.0, actionpack-7.0.8.4/lib/action_controller/metal/testing.rb has a method clear_instance_variables_between_requests.
    So report_data_additional_options is not set and it sets the model to the current model, which is VmOrTemplate.
    jrafanie committed Aug 2, 2024
    Configuration menu
    Copy the full SHA
    04ce526 View commit details
    Browse the repository at this point in the history
  2. Set "source" on the ems custom attribute by using the factory

    Without this, the source is set to nil and the ems custom attribute
    may not be persisted correctly, causing a test failure.
    jrafanie committed Aug 2, 2024
    Configuration menu
    Copy the full SHA
    9a50664 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    63dae15 View commit details
    Browse the repository at this point in the history