Maybe I don't know how to read ruby, but do we need `test_id == ''`?  Looks like this assigns test_id to "" if test_id is already "".  Also, the indentation differs from neighboring lines.