[Brightbox] Correct server snapshot test

Had a mistake in it was trying to use the Server's ID for the get image
request and resulted in calling destroy on a nil.

Also had to add a wait since the API does not allow deleting an image
that is being prepared.
This commit is contained in:
Paul Thornthwaite 2012-02-07 17:14:29 +00:00
parent e7313e555f
commit 41b0a3e754
1 changed files with 3 additions and 1 deletions

View File

@ -64,8 +64,10 @@ Shindo.tests('Fog::Compute[:brightbox] | server requests', ['brightbox']) do
pending if Fog.mocking?
result = Fog::Compute[:brightbox].snapshot_server(server_id)
formats(Brightbox::Compute::Formats::Full::SERVER, false) { result }
snapshot_id = result["id"]
# Server should be exclusively for our test so assume we can delete the snapshot
snapshot_id = result["snapshots"].first["id"]
@snapshot = Fog::Compute[:brightbox].images.get(snapshot_id)
@snapshot.wait_for { ready? }
@snapshot.destroy
end