[ANN] assert_latest now takes "polygamous" arguments

Railsters:

Those of you who dig ActiveRecord need this:

It shows how to write tests like this:

 t, fz = assert_latest T2, Foo do
           T2.create
           2.times{ Foo.create }
         end

 assert do
   t.id > 0     and
   fz[0].id > 0 and
   fz[1].id > fz[0].id
 end

The inner lines - T2.create etc. - represent your production code in
action. You
put the assert_latest around that code, and it will detect any new
records of
the given type. You can then assert the records have the fields you
expect.

The assertion is “polygamous” because you can pass any list of types in.
The
original version only took one type.

This is useful for any kind of testing, but super-useful for integration
tests,
to detect large batches of new records.

Get assert_latest with the assert_efficient_sql gem.


Phlip