Update register.js

added test to fix duplicate email problem