lib/brightbox-cli/vendor/fog/tests/aws/models/elb/model_tests.rb in brightbox-cli-0.16.0 vs lib/brightbox-cli/vendor/fog/tests/aws/models/elb/model_tests.rb in brightbox-cli-0.17.0

- old
+ new

@@ -31,11 +31,11 @@ elb = nil elb_id = 'fog-test' tests('create') do tests('without availability zones') do - elb = Fog::AWS[:elb].load_balancers.create(:id => elb_id) + elb = Fog::AWS[:elb].load_balancers.create(:id => elb_id, :availability_zones => @availability_zones) tests("availability zones are correct").returns(@availability_zones.sort) { elb.availability_zones.sort } tests("dns names is set").returns(true) { elb.dns_name.is_a?(String) } tests("created_at is set").returns(true) { Time === elb.created_at } tests("policies is empty").returns([]) { elb.policies } tests("default listener") do @@ -52,11 +52,11 @@ end # Need to sleep here for IAM changes to propgate tests('with ListenerDescriptions') do @certificate = Fog::AWS[:iam].upload_server_certificate(AWS::IAM::SERVER_CERT_PUBLIC_KEY, AWS::IAM::SERVER_CERT_PRIVATE_KEY, @key_name).body['Certificate'] - sleep(8) unless Fog.mocking? + sleep(10) unless Fog.mocking? listeners = [{ 'Listener' => { 'LoadBalancerPort' => 2030, 'InstancePort' => 2030, 'Protocol' => 'HTTP' }, 'PolicyNames' => [] @@ -65,11 +65,11 @@ 'LoadBalancerPort' => 443, 'InstancePort' => 443, 'Protocol' => 'HTTPS', 'SSLCertificateId' => @certificate['Arn'] }, 'PolicyNames' => [] }] - elb3 = Fog::AWS[:elb].load_balancers.create(:id => "#{elb_id}-3", 'ListenerDescriptions' => listeners) + elb3 = Fog::AWS[:elb].load_balancers.create(:id => "#{elb_id}-3", 'ListenerDescriptions' => listeners, :availability_zones => @availability_zones) tests('there are 2 listeners').returns(2) { elb3.listeners.count } tests('instance_port is 2030').returns(2030) { elb3.listeners.first.instance_port } tests('lb_port is 2030').returns(2030) { elb3.listeners.first.lb_port } tests('protocol is HTTP').returns('HTTP') { elb3.listeners.first.protocol } tests('protocol is HTTPS').returns('HTTPS') { elb3.listeners.last.protocol } @@ -79,10 +79,10 @@ tests('with invalid Server Cert ARN').raises(Fog::AWS::IAM::NotFound) do listeners = [{ 'Listener' => { 'LoadBalancerPort' => 443, 'InstancePort' => 80, 'Protocol' => 'HTTPS', "SSLCertificateId" => "fakecert"} }] - Fog::AWS[:elb].load_balancers.create(:id => "#{elb_id}-4", "ListenerDescriptions" => listeners) + Fog::AWS[:elb].load_balancers.create(:id => "#{elb_id}-4", "ListenerDescriptions" => listeners, :availability_zones => @availability_zones) end end tests('all') do elb_ids = Fog::AWS[:elb].load_balancers.all.map{|e| e.id}