ticket:3 tests for middleware
ticket:3 tests for views