mirror of
https://github.com/internetee/registry.git
synced 2025-06-06 20:55:44 +02:00
Move affected domains to the top of the hash, update integration test
This commit is contained in:
parent
3e81366cfc
commit
6fb1e44cca
6 changed files with 15 additions and 11 deletions
|
@ -37,8 +37,8 @@ module Repp
|
||||||
status 200
|
status 200
|
||||||
@response = { data: { type: 'nameserver',
|
@response = { data: { type: 'nameserver',
|
||||||
id: params[:data][:attributes][:hostname],
|
id: params[:data][:attributes][:hostname],
|
||||||
attributes: params[:data][:attributes],
|
attributes: params[:data][:attributes]},
|
||||||
affected_domains: affected_domains } }
|
affected_domains: affected_domains }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -44,7 +44,10 @@ class Registrar
|
||||||
parsed_response = JSON.parse(response.body, symbolize_names: true)
|
parsed_response = JSON.parse(response.body, symbolize_names: true)
|
||||||
|
|
||||||
if response.code == '200'
|
if response.code == '200'
|
||||||
flash[:notice] = t '.replaced'
|
notices = [t('.replaced')]
|
||||||
|
notices << "#{t('.affected_domains')}: #{parsed_response[:affected_domains].join(', ')}"
|
||||||
|
|
||||||
|
flash[:notice] = notices
|
||||||
redirect_to registrar_domains_url
|
redirect_to registrar_domains_url
|
||||||
else
|
else
|
||||||
@api_errors = parsed_response[:errors]
|
@api_errors = parsed_response[:errors]
|
||||||
|
|
|
@ -3,3 +3,4 @@ en:
|
||||||
nameservers:
|
nameservers:
|
||||||
update:
|
update:
|
||||||
replaced: Nameserver have been successfully replaced
|
replaced: Nameserver have been successfully replaced
|
||||||
|
affected_domains: Affected domains
|
||||||
|
|
|
@ -34,9 +34,9 @@ Content-Type: application/json
|
||||||
"hostname": "new-ns1.example.com",
|
"hostname": "new-ns1.example.com",
|
||||||
"ipv4": ["192.0.2.1", "192.0.2.2"],
|
"ipv4": ["192.0.2.1", "192.0.2.2"],
|
||||||
"ipv6": ["2001:db8::1", "2001:db8::2"]
|
"ipv6": ["2001:db8::1", "2001:db8::2"]
|
||||||
},
|
}
|
||||||
"affected_domains": ["example.com", "example.org"]
|
},
|
||||||
}
|
"affected_domains": ["example.com", "example.org"]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -54,8 +54,8 @@ class APINameserversPutTest < ActionDispatch::IntegrationTest
|
||||||
id: 'ns55.bestnames.test',
|
id: 'ns55.bestnames.test',
|
||||||
attributes: { hostname: 'ns55.bestnames.test',
|
attributes: { hostname: 'ns55.bestnames.test',
|
||||||
ipv4: ['192.0.2.55'],
|
ipv4: ['192.0.2.55'],
|
||||||
ipv6: ['2001:db8::55'] },
|
ipv6: ['2001:db8::55'] }},
|
||||||
affected_domains: ["airport.test", "shop.test"] } }),
|
affected_domains: ["airport.test", "shop.test"] }),
|
||||||
JSON.parse(response.body, symbolize_names: true)
|
JSON.parse(response.body, symbolize_names: true)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -16,9 +16,8 @@ class RegistrarAreaNameserverBulkChangeTest < ActionDispatch::IntegrationTest
|
||||||
basic_auth: ['test_goodnames', 'testtest'])
|
basic_auth: ['test_goodnames', 'testtest'])
|
||||||
.to_return(body: { data: [{
|
.to_return(body: { data: [{
|
||||||
type: 'nameserver',
|
type: 'nameserver',
|
||||||
id: 'new-ns.bestnames.test',
|
id: 'new-ns.bestnames.test'}],
|
||||||
affected_domains: ["airport.test", "shop.test"]
|
affected_domains: ["airport.test", "shop.test"]}.to_json, status: 200)
|
||||||
}] }.to_json, status: 200)
|
|
||||||
|
|
||||||
visit registrar_domains_url
|
visit registrar_domains_url
|
||||||
click_link 'Bulk change'
|
click_link 'Bulk change'
|
||||||
|
@ -33,6 +32,7 @@ class RegistrarAreaNameserverBulkChangeTest < ActionDispatch::IntegrationTest
|
||||||
assert_requested request_stub
|
assert_requested request_stub
|
||||||
assert_current_path registrar_domains_path
|
assert_current_path registrar_domains_path
|
||||||
assert_text 'Nameserver have been successfully replaced'
|
assert_text 'Nameserver have been successfully replaced'
|
||||||
|
assert_text 'Affected domains: airport.test, shop.test'
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_fails_gracefully
|
def test_fails_gracefully
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue