mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
7ee38ee2f6
Better handling of power state related tests
28 lines
919 B
Ruby
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
|