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

View file

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

View file

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