Fix tests

This commit is contained in:
Karl Erik Õunapuu 2020-10-16 12:33:50 +03:00
parent f2a1ee101b
commit 220e0d7993
No known key found for this signature in database
GPG key ID: C9DD647298A34764
6 changed files with 29 additions and 31 deletions

View file

@ -16,12 +16,15 @@ module Repp
end
def update
@epp_errors << { code: '2304', msg: 'New contact must be valid' } if @new_contact.invalid?
@epp_errors ||= []
@epp_errors << { code: 2304, msg: 'New contact must be valid' } if @new_contact.invalid?
if @new_contact == @current_contact
@epp_errors << { code: '2304', msg: 'New contact must be different from current' }
@epp_errors << { code: 2304, msg: 'New contact must be different from current' }
end
return handle_errors if @epp_errors.any?
affected, skipped = TechDomainContact.replace(@current_contact, @new_contact)
data = { affected_domains: affected, skipped_domains: skipped }
render_success(data: data)