Skip to content

Commit

Permalink
Add tests to check that cloud network list is dependent on zone
Browse files Browse the repository at this point in the history
  • Loading branch information
d-m-u committed Jan 17, 2018
1 parent 59187dc commit 3f3ee5b
Showing 1 changed file with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,10 @@

context "with VPC relationships" do
before do
@az1 = FactoryGirl.create(:availability_zone, :ext_management_system => ems)
@cn1 = FactoryGirl.create(:cloud_network, :ext_management_system => ems.network_manager)
@cs1 = FactoryGirl.create(:cloud_subnet, :cloud_network => @cn1)
@cs2 = FactoryGirl.create(:cloud_subnet, :cloud_network => @cn1)
FactoryGirl.create(:cloud_subnet, :cloud_network => @cn1, :availability_zone => @az1)
FactoryGirl.create(:cloud_subnet, :cloud_network => @cn1)
end

context "#allowed_cloud_subnets" do
Expand All @@ -175,6 +176,19 @@
expect(workflow.allowed_cloud_subnets.length).to eq(2)
end
end

context "#allowed_cloud_networks" do
it "#allowed_cloud_networks with zone" do
workflow.values[:placement_availability_zone] = [@az1.id, @az1.name]
cns = workflow.allowed_cloud_networks
expect(cns.keys).to match_array [@cn1.id]
end

it "#allowed_cloud_networks without availability zone returns nothing" do
cns = workflow.allowed_cloud_networks
expect(cns.keys).to match_array []
end
end
end

context "#display_name_for_name_description" do
Expand Down

0 comments on commit 3f3ee5b

Please sign in to comment.