refact test code to bdd style