Merge pull request #1814 from internetee/add-guard-clause-to-mass-nameserver-change

Bulk NS change: Verify CSV integrity
This commit is contained in:
Timo Võhmar 2021-06-25 14:43:00 +03:00 committed by GitHub
commit 22351c9053
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 180 additions and 61 deletions

View file

@ -94,4 +94,25 @@ class RegistrarAreaNameserverBulkChangeTest < ApplicationSystemTestCase
assert_text 'Nameserver have been successfully replaced'
assert_text 'Affected domains: shop.test'
end
def test_replaces_nameservers_with_invalid_domains_list
nameserver = nameservers(:shop_ns1)
visit registrar_domains_url
click_link 'Bulk change'
click_link 'Nameserver'
fill_in 'Old hostname', with: nameserver.hostname
fill_in 'New hostname', with: 'new-ns.bestnames.test'
fill_in 'ipv4', with: "192.0.2.55\n192.0.2.56"
fill_in 'ipv6', with: "2001:db8::55\n2001:db8::56"
attach_file :puny_file, Rails.root.join('test', 'fixtures', 'files', 'invalid_domains_for_ns_replacement.csv').to_s
assert_no_changes -> { nameserver.hostname } do
click_on 'Replace nameserver'
end
assert_current_path registrar_domains_path
assert_text 'CSV scoped domain list seems empty. Make sure that domains are added and "domain_name" header is present.'
end
end