From fcd17a37709a43caac1b590daa3be18113c8893a Mon Sep 17 00:00:00 2001 From: Adam Grare Date: Thu, 24 Sep 2020 11:10:40 -0400 Subject: [PATCH] Refactor the .types and .supported_types EMS specs Update the spec test to not require a hard-coded exhaustive list of EMS types from all of the plugins https://github.com/ManageIQ/manageiq/issues/19440 --- spec/models/ext_management_system_spec.rb | 51 ++--------------------- 1 file changed, 3 insertions(+), 48 deletions(-) diff --git a/spec/models/ext_management_system_spec.rb b/spec/models/ext_management_system_spec.rb index 539c3cc87a8..4e1b4634b51 100644 --- a/spec/models/ext_management_system_spec.rb +++ b/spec/models/ext_management_system_spec.rb @@ -49,58 +49,13 @@ described_class.create_discovered_ems(ost) end - let(:all_types_and_descriptions) do - { - "ansible_tower_automation" => "Ansible Tower Automation", - "azure" => "Azure", - "azure_network" => "Azure Network", - "azure_stack" => "Azure Stack", - "azure_stack_network" => "Azure Stack Network", - "ec2" => "Amazon EC2", - "ec2_network" => "Amazon EC2 Network", - "ec2_ebs_storage" => "Amazon EBS", - "embedded_ansible_automation" => "Embedded Ansible Automation", - "s3" => "Amazon S3", - "foreman_configuration" => "Foreman Configuration", - "foreman_provisioning" => "Foreman Provisioning", - "gce" => "Google Compute Engine", - "gce_network" => "Google Network", - "ibm_cloud_power_virtual_servers_network" => "IBM Power Systems Virtual Servers Network", - "ibm_cloud_power_virtual_servers" => "IBM Power Systems Virtual Servers", - "ibm_cloud_power_virtual_servers_storage" => "IBM Power Systems Virtual Servers Storage", - "ibm_cloud_vpc_network" => "IBM Cloud VPC Network", - "ibm_terraform_configuration" => "IBM Terraform Configuration", - "ibm_vpc" => "IBM Virtual Private Cloud", - "kubernetes" => "Kubernetes", - "kubernetes_monitor" => "Kubernetes Monitor", - "kubevirt" => "KubeVirt", - "openshift" => "OpenShift", - "openshift_monitor" => "Openshift Monitor", - "openstack" => "OpenStack", - "openstack_infra" => "OpenStack Platform Director", - "openstack_network" => "OpenStack Network", - "lenovo_ph_infra" => "Lenovo XClarity", - "nsxt" => "VMware NSX-T Network Manager", - "nuage_network" => "Nuage Network Manager", - "redfish_ph_infra" => "Redfish", - "redhat_network" => "Redhat Network", - "rhevm" => "Red Hat Virtualization", - "scvmm" => "Microsoft System Center VMM", - "vmwarews" => "VMware vCenter", - "vmware_cloud" => "VMware vCloud", - "vmware_cloud_network" => "VMware Cloud Network", - "cinder" => "Cinder ", - "swift" => "Swift ", - } - end - it ".types" do - expect(described_class.types).to match_array(all_types_and_descriptions.keys) + expect(described_class.types).to include("ec2", "vmwarews") end describe ".supported_types" do it "with default permissions" do - expect(described_class.supported_types).to match_array(all_types_and_descriptions.keys) + expect(described_class.supported_types).to include("ec2", "vmwarews") end it "with removed permissions" do @@ -112,7 +67,7 @@ describe ".supported_types_and_descriptions_hash" do it "with default permissions" do - expect(described_class.supported_types_and_descriptions_hash).to eq(all_types_and_descriptions) + expect(described_class.supported_types_and_descriptions_hash).to include("vmwarews" => "VMware vCenter") end it "with removed permissions" do