Create unit spec to RestrictWithError