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-maestrodev-1.18.0.20131206115947 tests/rackspace/models/dns/zones_tests.rb
fog-maestrodev-1.18.0.20131205181604 tests/rackspace/models/dns/zones_tests.rb
fog-maestrodev-1.18.0.20131127194823 tests/rackspace/models/dns/zones_tests.rb
fog-maestrodev-1.18.0.20131126183714 tests/rackspace/models/dns/zones_tests.rb
fog-maestrodev-1.18.0.20131126122111 tests/rackspace/models/dns/zones_tests.rb
fog-maestrodev-1.18.0.20131125111730 tests/rackspace/models/dns/zones_tests.rb
fog-maestrodev-1.18.0.20131125083406 tests/rackspace/models/dns/zones_tests.rb
fog-maestrodev-1.18.0.20131123105121 tests/rackspace/models/dns/zones_tests.rb
fog-maestrodev-1.18.0.20131122203507 tests/rackspace/models/dns/zones_tests.rb
fog-maestrodev-1.18.0.20131121075022 tests/rackspace/models/dns/zones_tests.rb
fog-maestrodev-1.18.0.20131118164830 tests/rackspace/models/dns/zones_tests.rb
fog-maestrodev-1.18.0.20131115184302 tests/rackspace/models/dns/zones_tests.rb
fog-maestrodev-1.18.0.20131114200144 tests/rackspace/models/dns/zones_tests.rb
gapinc-fog-1.12.1.2.1 tests/rackspace/models/dns/zones_tests.rb
fog-maestrodev-1.18.0.20131112185232 tests/rackspace/models/dns/zones_tests.rb
fog-maestrodev-1.18.0.20131111203459 tests/rackspace/models/dns/zones_tests.rb
fog-1.18.0 tests/rackspace/models/dns/zones_tests.rb
fog-1.17.0 tests/rackspace/models/dns/zones_tests.rb
fog-1.16.0 tests/rackspace/models/dns/zones_tests.rb
fog-maestrodev-1.15.0.20130927082724 tests/rackspace/models/dns/zones_tests.rb