1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/tests/digitalocean/requests/compute/create_server_tests.rb
Sergio Rubio 7ee38ee2f6 [digitalocean|compute] Improved tests reliability
Better handling of power state related tests
2013-03-31 22:16:13 +02:00

28 lines
919 B
Ruby

Shindo.tests('Fog::Compute[:digitalocean] | create_server request', ['digitalocean', 'compute']) do
@server_format = {
'id' => Integer,
'name' => String,
'image_id' => Integer,
'size_id' => Integer,
'event_id' => Integer
}
service = Fog::Compute[:digitalocean]
tests('success') do
tests('#create_server').formats({'status' => 'OK', 'droplet' => @server_format}) do
image = service.images.find { |img| img.name == 'Ubuntu 12.04 x64 Server' }
flavor = service.flavors.find { |f| f.name == '512MB' }
data = Fog::Compute[:digitalocean].create_server 'fog-test-server',
flavor.id,
image.id,
service.regions.first.id
data.body
end
end
end