Write tests for views

Test coverage for views is now at 100%.