Skip to content

Commit

Permalink
added test for domain tech contacts bulk change if domain has server …
Browse files Browse the repository at this point in the history
…update prohibited
  • Loading branch information
Oleg Hasjanov authored and yulgolem committed Jan 29, 2021
1 parent cb330d4 commit 8a39956
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/integration/api/domain_contacts_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,24 @@ def test_disallow_self_replacement
JSON.parse(response.body, symbolize_names: true)
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

def http_auth_key
Expand Down

0 comments on commit 8a39956

Please sign in to comment.