Added tests for preferences controller