Writing tests for registering handlers