Revert "Revert "Added a functional test for view precompilation""

This reverts commit 6b2ab32885a526bbfacbd7ff2aa7cdcc8e4cde5f.