where clauses in viewSpec were being ignored