Sha256: b5b40dbb466a094b4bbcbef3f8693ec0f2db8563e65674af20edb73496570d6a

Contents?: true

Size: 1.47 KB

Versions: 90

Compression:

Stored size: 1.47 KB

Contents

Shindo.tests('Fog::Rackspace::DNS | zones', ['rackspace']) do

  provider = Fog::DNS[:rackspace]
  domain_sld = uniq_id
  domain_name = domain_sld + '.com'

  begin
    unless Fog.mocking?
      zone = provider.zones.create({:domain => domain_name, :email => "hostmaster@#{domain_name}"})
    end

    tests("zones.find(#{domain_sld}) => finds domain_name") do
      pending if Fog.mocking?
      returns(true) { provider.zones.all.any? {|z| z.domain == domain_name} }
    end

    random_name = uniq_id
    tests("zones.find(#{random_name}) => finds nothing") do
      pending if Fog.mocking?
      returns(false) { provider.zones.all.any? {|z| z.domain == random_name} }
    end
  ensure
    zone.destroy unless Fog.mocking?
  end

  tests('next_params') do
    zones = Fog::DNS::Rackspace::Zones.new
    returns(nil, "no body") { zones.send(:next_params, nil)}
    returns(nil, "no links") { zones.send(:next_params, {}) }
    returns(nil, "links are empty") { zones.send(:next_params, {'links' => []}) }
    returns(nil, "links does not contain next hash") { zones.send(:next_params, {'links' => [ {'rel' => 'previous'} ] }) }
    returns(nil, "contains a link without parameters") { zones.send(:next_params, {'links' => [ {'rel' => 'next', 'href' => "http://localhost/next"} ] }) }
    returns({"offset"=>["3"], "limit"=>["3"]}, "contains a link without parameters") { zones.send(:next_params, {'links' => [ {'rel' => 'next', 'href' => "http://localhost/next?offset=3&limit=3"} ] }) }
  end

end

Version data entries

90 entries across 88 versions & 8 rubygems

Version Path
fog-1.30.0 tests/rackspace/models/dns/zones_tests.rb
fog-1.29.0 tests/rackspace/models/dns/zones_tests.rb
fog-1.28.0 tests/rackspace/models/dns/zones_tests.rb
fog-1.27.0 tests/rackspace/models/dns/zones_tests.rb
fog-1.26.0 tests/rackspace/models/dns/zones_tests.rb
fog-1.25.0 tests/rackspace/models/dns/zones_tests.rb
nsidc-fog-1.24.1 tests/rackspace/models/dns/zones_tests.rb
fog-1.24.0 tests/rackspace/models/dns/zones_tests.rb
ns-fog-1.22.11 tests/rackspace/models/dns/zones_tests.rb
ns-fog-1.22.10 tests/rackspace/models/dns/zones_tests.rb
ns-fog-1.22.9 tests/rackspace/models/dns/zones_tests.rb
ns-fog-1.22.8 tests/rackspace/models/dns/zones_tests.rb
ns-fog-1.22.7 tests/rackspace/models/dns/zones_tests.rb
ns-fog-1.22.6 tests/rackspace/models/dns/zones_tests.rb
fog-1.23.0 tests/rackspace/models/dns/zones_tests.rb
ns-fog-1.22.4 tests/rackspace/models/dns/zones_tests.rb
ns-fog-1.22.3 tests/rackspace/models/dns/zones_tests.rb
ns-fog-1.22.2 tests/rackspace/models/dns/zones_tests.rb
fog-1.22.1 tests/rackspace/models/dns/zones_tests.rb
fog-1.22.0 tests/rackspace/models/dns/zones_tests.rb