updated tests with before() method