Added tests for stats view queries