mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[aws|dns] Add model tests
This commit is contained in:
parent
4eb729a0b3
commit
8fd87b0338
4 changed files with 47 additions and 0 deletions
tests/aws/models/dns
16
tests/aws/models/dns/record_tests.rb
Normal file
16
tests/aws/models/dns/record_tests.rb
Normal file
|
@ -0,0 +1,16 @@
|
|||
Shindo.tests("Fog::Dns[:aws] | record", ['aws', 'dns']) do
|
||||
|
||||
pending if Fog.mocking?
|
||||
tests("zones#create").succeeds do
|
||||
@zone = Fog::DNS[:aws].zones.create(:domain => generate_unique_domain)
|
||||
end
|
||||
|
||||
params = { :name => @zone.domain, :type => 'A', :ttl => 3600, :value => ['1.2.3.4'] }
|
||||
model_tests(@zone.records, params, false)
|
||||
|
||||
tests("zones#destroy").succeeds do
|
||||
@zone.destroy
|
||||
end
|
||||
|
||||
end
|
||||
|
23
tests/aws/models/dns/records_tests.rb
Normal file
23
tests/aws/models/dns/records_tests.rb
Normal file
|
@ -0,0 +1,23 @@
|
|||
Shindo.tests("Fog::DNS[:aws] | records", ['aws', 'dns']) do
|
||||
|
||||
pending if Fog.mocking?
|
||||
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
|
||||
|
||||
tests("zones#destroy").succeeds do
|
||||
@zone.destroy
|
||||
end
|
||||
end
|
||||
|
4
tests/aws/models/dns/zone_tests.rb
Normal file
4
tests/aws/models/dns/zone_tests.rb
Normal file
|
@ -0,0 +1,4 @@
|
|||
Shindo.tests("Fog::DNS[:aws] | zone", ['aws', 'dns']) do
|
||||
params = {:domain => generate_unique_domain }
|
||||
model_tests(Fog::DNS[:aws].zones, params, false)
|
||||
end
|
4
tests/aws/models/dns/zones_tests.rb
Normal file
4
tests/aws/models/dns/zones_tests.rb
Normal file
|
@ -0,0 +1,4 @@
|
|||
Shindo.tests("Fog::DNS[:aws] | zones", ['aws', 'dns']) do
|
||||
params = {:domain => generate_unique_domain }
|
||||
collection_tests(Fog::DNS[:aws].zones, params, false)
|
||||
end
|
Loading…
Add table
Reference in a new issue