one more mocha case, refactor tests