Sha256: cdee59a487953c64d5adcf13544dfd9b2dabd51ae7a291e5b8eaeae3bd0b6efb
Contents?: true
Size: 1.67 KB
Versions: 2
Compression:
Stored size: 1.67 KB
Contents
require 'spec_helper' require 'vcloud_network_configurator/edge_gateway' describe EdgeGateway do it "should abort if vcloud api couldn't authenticate" do auth_request = mock(:authenticated? => false) VcloudAuthRequest.should_receive(:new).and_return(auth_request) auth_request.should_receive(:submit).and_return(mock()) eg = EdgeGateway.new({:api_url => 'eggplant.com', :edge_gateway_uuid => '123321'}) lambda { eg.apply_configuration }.should raise_error(SystemExit) end it "should authorize and configure changes" do vs = mock() VcloudSettings.should_receive(:new). with({url: 'eggplant.com', edge_gateway_uuid: '123321' }).and_return(vs) auth_request = mock(:authenticated? => true, :submit => true) VcloudAuthRequest.should_receive(:new).with(vs, "bringle@gds-aubergine", "eggplant"). and_return(auth_request) auth_request.should_receive(:auth_response).and_return({'x-vcloud-authorization' => '123213'}) VcloudConfigureRequest.should_receive(:new). with(vs, '123213', 'farm', 'firewall', 'path/to/dir'). and_return(mock(:submit => true, :success? => true, :response_body => nil)) EdgeGateway.any_instance.stub(:check_for_success => true) eg = EdgeGateway.new({:api_url => 'eggplant.com', :org_edgegateway_uuid => '123321', :username => 'bringle', :password => 'eggplant', :environment => 'farm', :organization => 'gds-aubergine', :component => 'firewall', :rules_directory => 'path/to/dir', }) eg.apply_configuration end end
Version data entries
2 entries across 2 versions & 2 rubygems
Version | Path |
---|---|
vcloud-net-spinner-0.1.2 | spec/vcloud_network_configurator/edge_gateway_spec.rb |
vcloud-network-configurator-0.1.0 | spec/vcloud_network_configurator/edge_gateway_spec.rb |