add test for ending_before