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

25 lines
896 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' }
flavor = service.flavors.find { |f| f.name == '512MB' }
data = Fog::Compute[:digitalocean].create_server fog_server_name,
flavor.id,
image.id,
service.regions.first.id
data.body
end
end
end