Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[service_template_ansible_playbook_spec.rb] Fix ems/provider lets
TRY TO MERGE TO MASTER!!!! This fix takes a page from a PR from David: ManageIQ#20031 Which was that instead of trying to assign the provider prior to making the EMS in the factories, default a provider object type as part of the `ext_management_system` child definition, and reference it in the `let(:provider)`. This is not a problem in Rails 5.2, but does lead to the following error in Rails 6.0 5) ServiceTemplateAnsiblePlaybook.create_catalog_item creates and returns a catalog item Failure/Error: factory_exists?(factory) ? super : class_from_symbol(factory).create!(*args) ActiveRecord::HasManyThroughCantAssociateThroughHasOneOrManyReflection: Cannot modify association 'ManageIQ::Providers::EmbeddedAnsible::Provider#endpoints' because the source reflection class 'Endpoint' is associated to 'ExtManagementSystem' via :has_many. # ./spec/support/missing_factory_helper.rb:10:in `create' # ./spec/models/service_template_ansible_playbook_spec.rb:11:in `block (2 levels) in <top (required)>' # ./spec/models/service_template_ansible_playbook_spec.rb:7:in `block (2 levels) in <top (required)>' # ./spec/models/service_template_ansible_playbook_spec.rb:15:in `block (2 levels) in <top (required)>' # ./spec/models/service_template_ansible_playbook_spec.rb:40:in `block (2 levels) in <top (required)>' # ./spec/models/service_template_ansible_playbook_spec.rb:47:in `block (2 levels) in <top (required)>' # ./spec/models/service_template_ansible_playbook_spec.rb:82:in `block (3 levels) in <top (required)>' Most likely do to a fix that I was unable to track down, but the following `git log command` is most likely to contain some of the commits with the fix: $ git log --oneline -E --grep "has.*many.*through" 5-2-stable..6-0-stable
- Loading branch information