added registrar controller tests

This commit is contained in:
olegphenomenon 2021-12-10 17:07:39 +02:00
parent c07abaea59
commit 95f5bad64b
3 changed files with 25 additions and 11 deletions

View file

@ -93,8 +93,8 @@ module Admin
return redirect_to request.referrer, notice: 'Registrar found, but not accreditated yet' if registrar_users.empty?
registrar_users.each do |api|
a = ApiUser.find_by(username: api.username, identity_code: api.identity_code)
Actions::RecordDateOfTest.record_result_to_api_user(a, api.accreditation_date) unless a.nil?
a = ApiUser.find_by(username: api['username'], identity_code: api['identity_code'])
Actions::RecordDateOfTest.record_result_to_api_user(api_user: a, date: api['accreditation_date']) unless a.nil?
end
redirect_to request.referrer, notice: 'Registrar found'