Added a functional test for view precompilation

@yishaigalatzer 
It's a bit unfortunate we can't use TestEnvironment here.