1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[Vcloud] Internet Service mock did not initialize its :nodes when added

This commit is contained in:
freeformz 2010-07-01 01:48:53 +08:00 committed by Wesley Beary
parent 1199b4154e
commit 72d05d2b54
2 changed files with 14 additions and 2 deletions

View file

@ -64,9 +64,13 @@ module Fog
validate_internet_service_data(service_data)
internet_services_uri = ensure_unparsed(internet_services_uri)
if ip = ip_from_uri(internet_services_uri)
new_service = service_data.merge!( { :href => Fog::Vcloud::Terremark::Ecloud::Mock.internet_service_href( { :id => rand(1000) } ), :timeout => 2 } )
id = rand(1000)
new_service = service_data.merge!( { :href => Fog::Vcloud::Terremark::Ecloud::Mock.internet_service_href( { :id => id } ),
:id => id.to_s,
:timeout => 2,
:nodes => [] } )
ip[:services] << new_service
xml = generate_internet_service_response( service_data, ip )

View file

@ -48,6 +48,14 @@ if Fog.mocking?
specify { public_ip[:Name].should == @public_ip.name }
specify { public_ip[:Id].should == @public_ip.id }
it "should update the mock object properly" do
subject
ip, service = @vcloud.mock_ip_and_service_from_service_url(body[:Href])
service[:href].should == body[:Href]
service[:id].should == body[:Id]
service[:nodes].should == []
end
end
context "with a public_ips_uri that doesn't exist" do