I would imagine they could still fire you since you still broke federal law. Also, if smoking weed, even if legal, was against company policy for whatever reason, they could still get rid of you. Weed smoker is not a protected employment status. I would imagine this would be especially true if you worked in a dangerous environment. If you worked in a refinery or something extremely dangerous, even if it is legal, they could terminate your license to work and make you go home. This would be true even if you took legal prescription drugs if they could inhibit your decision making abilities.
I think those weed test has little to do with the legality of weed but more to do with employers not wanting stoner employees who's high at work.
LEGAL POT COMPLICATES DRUG-FREE WORK POLICIES http://hosted.ap.org/dynamic/storie...ME&TEMPLATE=DEFAULT&CTIME=2012-12-07-17-31-43