Skip to content

Commit

Permalink
Merge pull request #177 from d-m-u/add_test_for_cloud_network_method
Browse files Browse the repository at this point in the history
Test az_to_cn method in vmware
  • Loading branch information
agrare authored Jan 22, 2018
2 parents 5042944 + 115385a commit d417fee
Showing 1 changed file with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
describe ManageIQ::Providers::Vmware::CloudManager::ProvisionWorkflow do
include Spec::Support::WorkflowHelper

let(:admin) { FactoryGirl.create(:user_with_group) }
let(:ems) { FactoryGirl.create(:ems_vmware_cloud) }
let(:template) { FactoryGirl.create(:template_vmware, :name => "template", :ext_management_system => ems) }
let(:workflow) do
stub_dialog
allow_any_instance_of(User).to receive(:get_timezone).and_return(Time.zone)
allow_any_instance_of(ManageIQ::Providers::CloudManager::ProvisionWorkflow).to receive(:update_field_visibility)

wf = described_class.new({:src_vm_id => template.id}, admin.userid)
wf
end

context "availability_zone_to_cloud_network" do
it "has one when it should" do
FactoryGirl.create(:cloud_network_google, :ext_management_system => ems.network_manager)

expect(workflow.allowed_cloud_networks.size).to eq(1)
end

it "has none when it should" do
expect(workflow.allowed_cloud_networks.size).to eq(0)
end
end
end

0 comments on commit d417fee

Please sign in to comment.