Spec for casting TimeWithZone to UUID

Also remove unnecessary `.to_time` call
Make if/else chain more consistent