Stop in for a cup of coffee

I think regardless of whether a substance is legal or even if it's a prescription, an employer can contend that you are impaired.
I would think that if a condition of employment is no drug use with the expectation of random tests then no matter what the law says - employer still trumps it...