Minor refactoring of views tests