-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #177 from d-m-u/add_test_for_cloud_network_method
Test az_to_cn method in vmware
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
spec/models/manageiq/providers/vmware/cloud_manager/provision_workflow_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |