Skip to content

Commit

Permalink
[Vcloud] Internet Service mock did not initialize its :nodes when added
Browse files Browse the repository at this point in the history
  • Loading branch information
freeformz authored and Wesley Beary committed Jun 30, 2010
1 parent 1199b41 commit 72d05d2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Expand Up @@ -64,9 +64,13 @@ def add_internet_service(internet_services_uri, service_data)
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 )

Expand Down
Expand Up @@ -48,6 +48,14 @@
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
Expand Down

0 comments on commit 72d05d2

Please sign in to comment.