Refactor specs after karma upgrade