mirror of
https://github.com/internetee/registry.git
synced 2025-06-09 22:24:47 +02:00
created method for adding nameservers
This commit is contained in:
parent
5d9692784f
commit
d36ef24170
3 changed files with 69 additions and 7 deletions
|
@ -34,6 +34,29 @@ class ReppV1RegistrarNameserversTest < ActionDispatch::IntegrationTest
|
|||
assert json[:data][:affected_domains].include? 'shop.test'
|
||||
end
|
||||
|
||||
def test_add_nameserver_values
|
||||
nameserver = nameservers(:shop_ns1)
|
||||
payload = {
|
||||
"data": {
|
||||
"type": 'nameserver',
|
||||
"domains": ['shop.test'],
|
||||
"attributes": {
|
||||
"hostname": "#{nameserver.hostname}.testtest",
|
||||
"ipv4": ['2.2.2.2']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
put '/repp/v1/registrar/nameservers', headers: @auth_headers, params: payload
|
||||
json = JSON.parse(response.body, symbolize_names: true)
|
||||
|
||||
assert_response :ok
|
||||
assert_equal 1000, json[:code]
|
||||
assert_equal 'Command completed successfully', json[:message]
|
||||
assert_equal({ hostname: "#{nameserver.hostname}.testtest", ipv4: ['2.2.2.2'] }, json[:data][:attributes])
|
||||
assert json[:data][:affected_domains].include? 'shop.test'
|
||||
end
|
||||
|
||||
def test_fails_to_update_if_prohibited
|
||||
domain = domains(:shop)
|
||||
domain.update(statuses: [DomainStatus::CLIENT_UPDATE_PROHIBITED])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue