fixed failing spec and refactored to DRY related spec