Sha256: 084d75cebe14fe5d990f30071a459248a4a83311a53945491e10a814bbe2f2c6

Contents?: true

Size: 963 Bytes

Versions: 34

Compression:

Stored size: 963 Bytes

Contents

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 { |i| i.name == 'Ubuntu 13.10 x64' }
      image_id = image.nil? ? 1505447 : image.id
      region = service.regions.find { |r| r.name == 'New York 1' }
      region_id = region.nil? ? 4 : region.id
      flavor = service.flavors.find { |r| r.name == '512MB' }
      flavor_id = flavor.nil? ? 66 : flavor.id

      data = Fog::Compute[:digitalocean].create_server(
        fog_server_name,
        flavor_id,
        image_id,
        region_id
      )
      data.body
    end
  end
end

Version data entries

34 entries across 34 versions & 5 rubygems

Version Path
ns-fog-1.22.9 tests/digitalocean/requests/compute/create_server_tests.rb
ns-fog-1.22.8 tests/digitalocean/requests/compute/create_server_tests.rb
ns-fog-1.22.7 tests/digitalocean/requests/compute/create_server_tests.rb
ns-fog-1.22.6 tests/digitalocean/requests/compute/create_server_tests.rb
fog-1.23.0 tests/digitalocean/requests/compute/create_server_tests.rb
ns-fog-1.22.4 tests/digitalocean/requests/compute/create_server_tests.rb
ns-fog-1.22.3 tests/digitalocean/requests/compute/create_server_tests.rb
ns-fog-1.22.2 tests/digitalocean/requests/compute/create_server_tests.rb
fog-1.22.1 tests/digitalocean/requests/compute/create_server_tests.rb
fog-1.22.0 tests/digitalocean/requests/compute/create_server_tests.rb
fog-1.21.0 tests/digitalocean/requests/compute/create_server_tests.rb
fog-maestrodev-1.20.0.20140305101839 tests/digitalocean/requests/compute/create_server_tests.rb
fog-maestrodev-1.20.0.20140305101305 tests/digitalocean/requests/compute/create_server_tests.rb
fog-1.20.0 tests/digitalocean/requests/compute/create_server_tests.rb