Write tests for dialogs controller