fix context_pages_controller with tests