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.21.0 tests/rackspace/models/dns/zones_tests.rb
fog-maestrodev-1.20.0.20140305101839 tests/rackspace/models/dns/zones_tests.rb
fog-maestrodev-1.20.0.20140305101305 tests/rackspace/models/dns/zones_tests.rb
fog-maestrodev-1.19.0.20140212012611 tests/rackspace/models/dns/zones_tests.rb
fog-1.20.0 tests/rackspace/models/dns/zones_tests.rb
fog-maestrodev-1.19.0.20140110004459 tests/rackspace/models/dns/zones_tests.rb
fog-maestrodev-1.19.0.20140110003812 tests/rackspace/models/dns/zones_tests.rb
fog-maestrodev-1.19.0.20140109202555 tests/rackspace/models/dns/zones_tests.rb
fog-maestrodev-1.19.0.20140107192102 tests/rackspace/models/dns/zones_tests.rb
fog-maestrodev-1.19.0.20140107142106 tests/rackspace/models/dns/zones_tests.rb
fog-maestrodev-1.19.0.20131219203941 tests/rackspace/models/dns/zones_tests.rb
fog-maestrodev-1.18.0.20131219193542 tests/rackspace/models/dns/zones_tests.rb
fog-1.19.0 tests/rackspace/models/dns/zones_tests.rb
fog-maestrodev-1.18.0.20131219033443 tests/rackspace/models/dns/zones_tests.rb
fog-maestrodev-1.18.0.20131219032002 tests/rackspace/models/dns/zones_tests.rb
fog-maestrodev-1.18.0.20131219030716 tests/rackspace/models/dns/zones_tests.rb
fog-maestrodev-1.18.0.20131219022322 tests/rackspace/models/dns/zones_tests.rb
fog-maestrodev-1.18.0.20131218202447 tests/rackspace/models/dns/zones_tests.rb
fog-maestrodev-1.18.0.20131209091424 tests/rackspace/models/dns/zones_tests.rb
fog-maestrodev-1.18.0.20131209090811 tests/rackspace/models/dns/zones_tests.rb