changed then to when, uncommented tests