updated tests for before and after blocks