Updated User class and user_management_spec.rb files to prevent duplicate registrations