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:
parent
9772bd7822
commit
89de6ba31c
6 changed files with 10 additions and 11 deletions
|
@ -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
|
||||
|
|
|
@ -9,7 +9,7 @@ module Fog
|
|||
|
||||
identity :id
|
||||
|
||||
attribute :domain, :aliases => [:name, 'name']
|
||||
attribute :domain, :aliases => 'name'
|
||||
attribute :created_at
|
||||
attribute :updated_at
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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])
|
||||
|
|
|
@ -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])
|
||||
|
|
Loading…
Add table
Reference in a new issue