A Worksop van driver was caught with cannabis after his passenger stuck his middle finger up at pedestrians, magistrates have heard.