#1278 Reduce code duplication - fix test