add test for pattern controller