2012-02-25 11:35:16 -05:00
|
|
|
Shindo.tests("Fog::DNS[:aws] | records", ['aws', 'dns']) do
|
|
|
|
pending if Fog.mocking?
|
2012-07-04 11:33:51 -04:00
|
|
|
|
2012-02-25 11:35:16 -05:00
|
|
|
tests("zones#create").succeeds do
|
|
|
|
@zone = Fog::DNS[:aws].zones.create(:domain => generate_unique_domain)
|
|
|
|
end
|
|
|
|
|
|
|
|
param_groups = [
|
|
|
|
# A record
|
|
|
|
{ :name => @zone.domain, :type => 'A', :ttl => 3600, :value => ['1.2.3.4'] },
|
|
|
|
# CNAME record
|
|
|
|
{ :name => "www.#{@zone.domain}", :type => "CNAME", :ttl => 300, :value => @zone.domain}
|
|
|
|
]
|
|
|
|
|
|
|
|
param_groups.each do |params|
|
|
|
|
collection_tests(@zone.records, params, false)
|
|
|
|
end
|
|
|
|
|
2012-07-04 11:33:51 -04:00
|
|
|
records = []
|
|
|
|
|
|
|
|
100.times do |i|
|
|
|
|
records << @zone.records.create(:name => "#{i}.#{@zone.domain}", :type => "A", :ttl => 3600, :value => ['1.2.3.4'])
|
|
|
|
end
|
|
|
|
|
|
|
|
tests("#all!").returns(102) do
|
|
|
|
@zone.records.all!.size
|
|
|
|
end
|
|
|
|
|
|
|
|
tests("#all!").returns(102) do
|
|
|
|
@zone.records.all!.size
|
|
|
|
end
|
|
|
|
|
|
|
|
records.each do |record|
|
|
|
|
record.destroy
|
|
|
|
end
|
|
|
|
|
2012-02-25 11:35:16 -05:00
|
|
|
tests("zones#destroy").succeeds do
|
|
|
|
@zone.destroy
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|