Refactor spec test to remove duplication