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
|
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
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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])
|
||||||
|
|
|
@ -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])
|
||||||
|
|
Loading…
Add table
Reference in a new issue