refactor edit and new page; improve user_pages_spec testing