1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[digitalocean|compute] additional test coverage and some maintenance

* Add created_at field to mock response
* Assert that the created_at field is returned
* Update references to nonexistent images
This commit is contained in:
Dave Donahue 2013-12-27 10:03:22 -06:00
parent 13e3d7a010
commit 25c518cbc2
4 changed files with 6 additions and 4 deletions

View file

@ -54,7 +54,8 @@ module Fog
"image_id" => image_id,
"region_id" => region_id,
"ip_address" => "127.0.0.1",
"status" => 'active'
"status" => 'active',
"created_at" => Time.now.strftime("%FT%TZ")
}
response.body = {

View file

@ -5,7 +5,7 @@ def service
end
def fog_test_server_attributes
image = service.images.find { |i| i.name == 'Ubuntu 12.04 x64' }
image = service.images.find { |i| i.name == 'Ubuntu 13.10 x64' }
region = service.regions.find { |r| r.name == 'New York 1' }
flavor = service.flavors.find { |r| r.name == '512MB' }

View file

@ -13,7 +13,7 @@ Shindo.tests('Fog::Compute[:digitalocean] | create_server request', ['digitaloce
tests('success') do
tests('#create_server').formats({'status' => 'OK', 'droplet' => @server_format}) do
image = service.images.find { |img| img.name == 'Ubuntu 12.04 x64' }
image = service.images.find { |img| img.name == 'Ubuntu 13.10 x64' }
flavor = service.flavors.find { |f| f.name == '512MB' }
data = Fog::Compute[:digitalocean].create_server fog_server_name,
flavor.id,

View file

@ -8,7 +8,8 @@ Shindo.tests('Fog::Compute[:digitalocean] | list_servers request', ['digitalocea
'region_id' => Integer,
'backups_active' => Fog::Nullable::Boolean,
'ip_address' => Fog::Nullable::String,
'status' => String
'status' => String,
'created_at' => String
}
tests('success') do