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-rackspace-0.1.6 tests/rackspace/models/dns/zones_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-rackspace-0.1.5/tests/rackspace/models/dns/zones_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-rackspace-0.1.5/tests/rackspace/models/dns/zones_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-rackspace-0.1.5/tests/rackspace/models/dns/zones_tests.rb
fog-rackspace-0.1.5 tests/rackspace/models/dns/zones_tests.rb
fog-rackspace-0.1.4 tests/rackspace/models/dns/zones_tests.rb
fog-rackspace-0.1.3 tests/rackspace/models/dns/zones_tests.rb
fog-rackspace-0.1.2 tests/rackspace/models/dns/zones_tests.rb
fog-rackspace-0.1.1 tests/rackspace/models/dns/zones_tests.rb
fog-rackspace-0.1.0 tests/rackspace/models/dns/zones_tests.rb
fog-1.37.0 tests/rackspace/models/dns/zones_tests.rb
fog-1.36.0 tests/rackspace/models/dns/zones_tests.rb
fog-1.35.0 tests/rackspace/models/dns/zones_tests.rb
fog-2.0.0.pre.0 tests/rackspace/models/dns/zones_tests.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/tests/rackspace/models/dns/zones_tests.rb
fog-1.34.0 tests/rackspace/models/dns/zones_tests.rb
fog-1.33.0 tests/rackspace/models/dns/zones_tests.rb
fog-1.32.0 tests/rackspace/models/dns/zones_tests.rb
fog-1.31.0 tests/rackspace/models/dns/zones_tests.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/tests/rackspace/models/dns/zones_tests.rb