Skip to content

Commit

Permalink
Merge pull request #69 from Shopify/remove-alias-points-to-root
Browse files Browse the repository at this point in the history
remove alias-points-to-root validation
  • Loading branch information
stonith committed Jul 18, 2018
2 parents 242eabb + 059f61c commit 9dc67d2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 15 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,8 @@
# CHANGELOG

## 5.2.1
- remove alias at domain root validation

## 5.2.0
- limit request rate for DynECT API to avoid 429 errors [FEATURE]

Expand Down
2 changes: 1 addition & 1 deletion lib/record_store/version.rb
@@ -1,3 +1,3 @@
module RecordStore
VERSION = '5.2.0'.freeze
VERSION = '5.2.1'.freeze
end
1 change: 0 additions & 1 deletion lib/record_store/zone.rb
Expand Up @@ -15,7 +15,6 @@ class Zone
validate :validate_same_ttl_for_records_sharing_fqdn_and_type
validate :validate_provider_can_handle_zone_records
validate :validate_can_handle_alias_records
validate :validate_alias_points_to_root

class << self
def download(name, provider_name, **write_options)
Expand Down
13 changes: 0 additions & 13 deletions test/zone_test.rb
Expand Up @@ -358,19 +358,6 @@ def test_zone_validates_support_for_alias_records
assert_match /does not support ALIAS records/, invalid_zone.errors[:records].first
end

def test_zone_validates_alias_points_to_root
valid_zone = Zone.new(name: 'matching-records.com', config: { providers: ['DynECT'], supports_alias: true }, records: [
{ type: 'ALIAS', fqdn: 'matching-records.com', alias: 'matching-records.herokuapp.com', ttl: 60 },
])
assert_predicate valid_zone, :valid?

invalid_zone = Zone.new(name: 'matching-records.com', config: { providers: ['DynECT'], supports_alias: true }, records: [
{ type: 'ALIAS', fqdn: 'alias.matching-records.com', alias: 'matching-records.herokuapp.com', ttl: 60 },
])
refute_predicate invalid_zone, :valid?
assert_equal 'ALIAS record should be defined on the root of the zone: [ALIASRecord] alias.matching-records.com. 60 IN ALIAS matching-records.herokuapp.com.', invalid_zone.errors[:records].first
end

def test_modified_returns_all_zones_with_changes
zone_a = Zone.find('one-record.com')
zone_a.stubs(:build_changesets).returns([populated_changeset])
Expand Down

0 comments on commit 9dc67d2

Please sign in to comment.