1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[dns] fix tests to use domain instead of name for zone

This commit is contained in:
geemus 2011-02-25 15:10:12 -08:00
parent 9772bd7822
commit 89de6ba31c
6 changed files with 10 additions and 11 deletions

View file

@ -9,12 +9,12 @@ module Fog
identity :id identity :id
attribute :name attribute :domain, :aliases => 'name'
attribute :serial attribute :serial
attribute :ttl attribute :ttl
attribute :retry attribute :retry
attribute :expires attribute :expires
attribute :record_count, :aliases => 'record-count' attribute :record_count, :aliases => 'record-count'
attribute :refresh attribute :refresh
attribute :minimum attribute :minimum
@ -50,8 +50,9 @@ module Fog
end end
def save def save
requires :name, :ttl requires :domain, :ttl
options = attributes.inject({}) {|h, kv| h[kv[0]] = kv[1]; h} options = attributes.dup
options[:name] = options.delete(:domain)
data = identity.nil? ? connection.create_zone(options) : connection.update_zone(identity, options) data = identity.nil? ? connection.create_zone(options) : connection.update_zone(identity, options)
merge_attributes(data.body) merge_attributes(data.body)
true true

View file

@ -9,7 +9,7 @@ module Fog
identity :id identity :id
attribute :domain, :aliases => [:name, 'name'] attribute :domain, :aliases => 'name'
attribute :created_at attribute :created_at
attribute :updated_at attribute :updated_at

View file

@ -10,8 +10,7 @@ for provider, config in dns_providers
if !Fog.mocking? || config[:mocked] if !Fog.mocking? || config[:mocked]
zone_attributes = { zone_attributes = {
:name => 'fogrecordtests.com', :domain => 'fogrecordtests.com'
:ttl => 60
}.merge(config[:zone_attributes] || {}) }.merge(config[:zone_attributes] || {})
@zone = provider[:dns].zones.create(zone_attributes) @zone = provider[:dns].zones.create(zone_attributes)

View file

@ -10,7 +10,7 @@ for provider, config in dns_providers
if !Fog.mocking? || config[:mocked] if !Fog.mocking? || config[:mocked]
zone_attributes = { zone_attributes = {
:name => 'fogrecordstests.com' :domain => 'fogrecordstests.com'
}.merge(config[:zone_attributes] || {}) }.merge(config[:zone_attributes] || {})
@zone = provider[:dns].zones.create(zone_attributes) @zone = provider[:dns].zones.create(zone_attributes)

View file

@ -3,7 +3,7 @@ for provider, config in dns_providers
Shindo.tests("#{provider}::DNS | zone", [provider.to_s.downcase]) do Shindo.tests("#{provider}::DNS | zone", [provider.to_s.downcase]) do
zone_attributes = { zone_attributes = {
:name => 'fogzonetests.com' :domain => 'fogzonetests.com'
}.merge!(config[:zone_attributes] || {}) }.merge!(config[:zone_attributes] || {})
model_tests(provider[:dns].zones, zone_attributes, config[:mocked]) model_tests(provider[:dns].zones, zone_attributes, config[:mocked])

View file

@ -3,8 +3,7 @@ for provider, config in dns_providers
Shindo.tests("#{provider}::DNS | zones", [provider.to_s.downcase]) do Shindo.tests("#{provider}::DNS | zones", [provider.to_s.downcase]) do
zone_attributes = { zone_attributes = {
:name => 'fogzonestests.com', :domain => 'fogzonestests.com'
:ttl => 60
}.merge!(config[:zone_attributes] || {}) }.merge!(config[:zone_attributes] || {})
collection_tests(provider[:dns].zones, zone_attributes, config[:mocked]) collection_tests(provider[:dns].zones, zone_attributes, config[:mocked])