There is a lot of repetition in this test - we probably should refactor at some point