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
fog-1.37.0 tests/digitalocean/requests/compute/create_server_tests.rb
fog-1.36.0 tests/digitalocean/requests/compute/create_server_tests.rb
fog-1.35.0 tests/digitalocean/requests/compute/create_server_tests.rb
fog-2.0.0.pre.0 tests/digitalocean/requests/compute/create_server_tests.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/tests/digitalocean/requests/compute/create_server_tests.rb
fog-1.34.0 tests/digitalocean/requests/compute/create_server_tests.rb
fog-1.33.0 tests/digitalocean/requests/compute/create_server_tests.rb
fog-1.32.0 tests/digitalocean/requests/compute/create_server_tests.rb
fog-1.31.0 tests/digitalocean/requests/compute/create_server_tests.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/tests/digitalocean/requests/compute/create_server_tests.rb
fog-1.30.0 tests/digitalocean/requests/compute/create_server_tests.rb
fog-1.29.0 tests/digitalocean/requests/compute/create_server_tests.rb
fog-1.28.0 tests/digitalocean/requests/compute/create_server_tests.rb
fog-1.27.0 tests/digitalocean/requests/compute/create_server_tests.rb
fog-1.26.0 tests/digitalocean/requests/compute/create_server_tests.rb
fog-1.25.0 tests/digitalocean/requests/compute/create_server_tests.rb
nsidc-fog-1.24.1 tests/digitalocean/requests/compute/create_server_tests.rb
fog-1.24.0 tests/digitalocean/requests/compute/create_server_tests.rb
ns-fog-1.22.11 tests/digitalocean/requests/compute/create_server_tests.rb
ns-fog-1.22.10 tests/digitalocean/requests/compute/create_server_tests.rb