tests for titles and refactors with layout erb