How to do realworld generating test with spec?

@MageMasher thanks for sharing!

I knew I can write generators, but the problem is not about the api or syntax, is about how to write suitable generators.