mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 14:44:47 +02:00
added test for admin bulk change when domain has status update prohibited
This commit is contained in:
parent
a05f21c86c
commit
275da4645a
1 changed files with 18 additions and 0 deletions
|
@ -107,6 +107,24 @@ class APIDomainAdminContactsTest < ApplicationIntegrationTest
|
|||
JSON.parse(response.body, symbolize_names: true)
|
||||
end
|
||||
|
||||
def test_admin_bulk_changed_when_domain_update_prohibited
|
||||
domains(:shop).update!(statuses: [DomainStatus::SERVER_UPDATE_PROHIBITED])
|
||||
|
||||
shop_admin_contact = Contact.find_by(code: 'jane-001')
|
||||
assert domains(:shop).admin_contacts.include?(shop_admin_contact)
|
||||
|
||||
patch '/repp/v1/domains/admin_contacts', params: { current_contact_id: 'jane-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
|
||||
|
||||
def http_auth_key
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue