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

Restore all previous TreeNodeBuilder#build functionality and add specs #12060

Merged
merged 5 commits into from
Oct 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
169 changes: 85 additions & 84 deletions app/presenters/tree_node_builder.rb

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions app/presenters/tree_node_builder_datacenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ def normal_folder_node

def vm_node(object)
image = "currentstate-#{object.normalized_state.downcase}.png"
if object.template?
image = object.host ? "template.png" : "template-no-host.png"
unless object.template?
tip = _("VM: %{name}") % {:name => object.name}
end
generic_node(object.name, image, _("VM: %{name}") % {:name => object.name})
generic_node(object.name, image, tip)
end
end
8 changes: 8 additions & 0 deletions spec/factories/availability_zone.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
factory :availability_zone_amazon, :parent => :availability_zone, :class => "ManageIQ::Providers::Amazon::CloudManager::AvailabilityZone" do
end

factory :availability_zone_azure,
:parent => :availability_zone,
:class => "ManageIQ::Providers::Azure::CloudManager::AvailabilityZone"

factory :availability_zone_openstack, :parent => :availability_zone, :class => "ManageIQ::Providers::Openstack::CloudManager::AvailabilityZone" do
end

Expand All @@ -15,6 +19,10 @@
factory :availability_zone_google, :parent => :availability_zone, :class => "ManageIQ::Providers::Google::CloudManager::AvailabilityZone" do
end

factory :availability_zone_vmware,
:parent => :availability_zone,
:class => "ManageIQ::Providers::Vmware::CloudManager::AvailabilityZone"

factory :availability_zone_target, :parent => :availability_zone do
after(:create) do |x|
x.perf_capture_enabled = true
Expand Down
11 changes: 10 additions & 1 deletion spec/factories/configuration_profile.rb
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
FactoryGirl.define { factory :configuration_profile }
FactoryGirl.define do
factory :configuration_profile

factory :configuration_profile_forman,
:aliases => ["manageiq/providers/foreman/configuration_manager/configuration_profile"],
:class => "ManageIQ::Providers::Foreman::ConfigurationManager::ConfigurationProfile",
:parent => :configuration_profile do
name "foreman config profile"
end
end
8 changes: 8 additions & 0 deletions spec/factories/configured_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,12 @@
factory :configured_system do
sequence(:name) { |n| "Configured_system_#{seq_padded_for_sorting(n)}" }
end

factory :configured_system_foreman,
:class => "ManageIQ::Providers::Foreman::ConfigurationManager::ConfiguredSystem",
:parent => :configured_system

factory :configured_system_ansible_tower,
:class => "ManageIQ::Providers::AnsibleTower::ConfigurationManager::ConfiguredSystem",
:parent => :configured_system
end
1 change: 0 additions & 1 deletion spec/factories/configured_system_foreman.rb

This file was deleted.

22 changes: 22 additions & 0 deletions spec/factories/customization_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,26 @@
x.pxe_image_type ||= FactoryGirl.create(:pxe_image_type)
end
end

factory :customization_template_cloud_init do
after(:build) do |x|
x.pxe_image_type ||= FactoryGirl.create(:pxe_image_type)
end
end

factory :customization_template_kickstart do
sequence(:name) { |n| "customization_template_kickstart_#{seq_padded_for_sorting(n)}" }
sequence(:description) { |n| "Customization Template Kickstart #{seq_padded_for_sorting(n)}" }
after(:build) do |x|
x.pxe_image_type ||= FactoryGirl.create(:pxe_image_type)
end
end

factory :customization_template_sysprep do
sequence(:name) { |n| "customization_template_syspre_#{seq_padded_for_sorting(n)}" }
sequence(:description) { |n| "Customization Template Sysprep #{seq_padded_for_sorting(n)}" }
after(:build) do |x|
x.pxe_image_type ||= FactoryGirl.create(:pxe_image_type)
end
end
end
7 changes: 0 additions & 7 deletions spec/factories/customization_template_cloud_init.rb

This file was deleted.

9 changes: 0 additions & 9 deletions spec/factories/customization_template_kickstart.rb

This file was deleted.

8 changes: 8 additions & 0 deletions spec/factories/ems_folder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,12 @@
factory :datacenter, :parent => :ems_folder, :class => "Datacenter"

factory :storage_cluster, :parent => :ems_folder, :class => "StorageCluster"

factory :inventory_group,
:class => "ManageIQ::Providers::ConfigurationManager::InventoryGroup",
:parent => :ems_folder

factory :inventory_root_group,
:class => "ManageIQ::Providers::ConfigurationManager::InventoryRootGroup",
:parent => :ems_folder
end
36 changes: 21 additions & 15 deletions spec/factories/ext_management_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,27 @@
end
end

factory :ems_azure,
:aliases => ["manageiq/providers/azure/cloud_manager"],
:class => "ManageIQ::Providers::Azure::CloudManager",
:parent => :ems_cloud do
end

factory :ems_azure_network,
:aliases => ["manageiq/providers/azure/network_manager"],
:class => "ManageIQ::Providers::Azure::NetworkManager",
:parent => :ems_network do
end

factory :ems_azure_with_authentication,
:parent => :ems_azure do
azure_tenant_id "ABCDEFGHIJABCDEFGHIJ0123456789AB"
subscription "0123456789ABCDEFGHIJABCDEFGHIJKL"
after :create do |x|
x.authentications << FactoryGirl.create(:authentication)
end
end

factory :ems_openstack,
:aliases => ["manageiq/providers/openstack/cloud_manager"],
:class => "ManageIQ::Providers::Openstack::CloudManager",
Expand Down Expand Up @@ -316,21 +337,6 @@
end
end

factory :ems_azure,
:aliases => ["manageiq/providers/azure/cloud_manager"],
:class => "ManageIQ::Providers::Azure::CloudManager",
:parent => :ems_cloud do
end

factory :ems_azure_with_authentication,
:parent => :ems_azure do
azure_tenant_id "ABCDEFGHIJABCDEFGHIJ0123456789AB"
subscription "0123456789ABCDEFGHIJABCDEFGHIJKL"
after :create do |x|
x.authentications << FactoryGirl.create(:authentication)
end
end

# Leaf classes for middleware_manager

factory :ems_hawkular,
Expand Down
7 changes: 7 additions & 0 deletions spec/factories/template_vmware_cloud.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FactoryGirl.define do
factory :template_vmware_cloud,
:class => "ManageIQ::Providers::Vmware::CloudManager::Template",
:parent => :template_cloud do
vendor "vmware"
end
end
4 changes: 4 additions & 0 deletions spec/factories/vm_or_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
factory(:vm, :class => "Vm", :parent => :vm_or_template)
factory(:vm_cloud, :class => "VmCloud", :parent => :vm) { cloud true }
factory(:vm_infra, :class => "VmInfra", :parent => :vm)
factory(:vm_server, :class => "VmServer", :parent => :vm)
factory(:vm_xen, :class => "VmXen", :parent => :vm_infra)
factory(:template_cloud, :class => "TemplateCloud", :parent => :template) { cloud true }
factory(:template_infra, :class => "TemplateInfra", :parent => :template)

Expand All @@ -28,4 +30,6 @@
location { |x| "#{x.name}/#{x.name}.img.manifest.xml" }
vendor "amazon"
end

factory(:template_xen, :class => "TemplateXen", :parent => :template_infra)
end