mirror of
https://github.com/internetee/registry.git
synced 2025-06-08 13:44:47 +02:00
added test for domain tech contacts bulk change if domain has server update prohibited
This commit is contained in:
parent
35a6438cf4
commit
a7e303bba2
1 changed files with 18 additions and 0 deletions
|
@ -107,6 +107,24 @@ class APIDomainContactsTest < ApplicationIntegrationTest
|
||||||
JSON.parse(response.body, symbolize_names: true)
|
JSON.parse(response.body, symbolize_names: true)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_tech_bulk_changed_when_domain_update_prohibited
|
||||||
|
domains(:shop).update!(statuses: [DomainStatus::SERVER_UPDATE_PROHIBITED])
|
||||||
|
|
||||||
|
shop_tech_contact = Contact.find_by(code: 'william-001')
|
||||||
|
assert domains(:shop).tech_contacts.include?(shop_tech_contact)
|
||||||
|
|
||||||
|
patch '/repp/v1/domains/contacts', params: { current_contact_id: 'william-001',
|
||||||
|
new_contact_id: 'john-001' },
|
||||||
|
headers: { 'HTTP_AUTHORIZATION' => http_auth_key }
|
||||||
|
|
||||||
|
assert_response :ok
|
||||||
|
assert_equal ({ code: 1000,
|
||||||
|
message: 'Command completed successfully',
|
||||||
|
data: { affected_domains: ["airport.test"],
|
||||||
|
skipped_domains: ["shop.test"] }}),
|
||||||
|
JSON.parse(response.body, symbolize_names: true)
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def http_auth_key
|
def http_auth_key
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue