Added new controller "ldap_test_controller".
Updated _form.html.slim to add test button and message.
Updated application.js to add jquery logic to test button in place and
modify message.
Updated routes.rb for new controller.
Added RSpec tests.
Other notes:
RSpec tests require a working LDAP server. Additionally, the LDAP server must allow for anonymous binds, support TLS and be populated with at least one user having "objectClass=person". The certificate in the tests is pulled from the dockerized LDAP server used during development/testing and can be found here: https://github.com/osixia/docker-openldap
There are coverage guards/exceptions around two "rescue StandardError" code blocks in ldap_test_controller.rb. These blocks are fail-safes in case the error-handling blocks above them fail to catch an error. Fail-safes are deemed necessary in both cases because the "begin" blocks run "net/ldap" code which is light on documentation regarding errors. We are not currently aware of a state that will enter these "rescue StandardError" code blocks, thus they are skipped in testing.
Added new controller "ldap_test_controller". Updated _form.html.slim to add test button and message. Updated application.js to add jquery logic to test button in place and modify message. Updated routes.rb for new controller. Added RSpec tests.
Other notes: RSpec tests require a working LDAP server. Additionally, the LDAP server must allow for anonymous binds, support TLS and be populated with at least one user having "objectClass=person". The certificate in the tests is pulled from the dockerized LDAP server used during development/testing and can be found here: https://github.com/osixia/docker-openldap
There are coverage guards/exceptions around two "rescue StandardError" code blocks in ldap_test_controller.rb. These blocks are fail-safes in case the error-handling blocks above them fail to catch an error. Fail-safes are deemed necessary in both cases because the "begin" blocks run "net/ldap" code which is light on documentation regarding errors. We are not currently aware of a state that will enter these "rescue StandardError" code blocks, thus they are skipped in testing.