It is standard practice to test everyone between 26 and 28 weeks, no matter if there is a history of diabetes or not.
If there is GD in your family, or someone close (parent or grand-parent) has either types of diabetes, they usually test you early if you are either overweight, smoking, or generally had a history of hypo or hyper glycemia in the past.
My mother never had GD, but she did develop Type 2 Diabetes after her cancer, and Type 1 is all over my family tree. I was hypoglycemic as a child/teen, and most of my health concerns then were tied to my blood sugar levels (migraines, vision troubles, etc) so they tested me early since I was having severe migraines from 7 weeks on, thinking it might be tied to that.