thoughtbot/shoulda-matchers — pull request #125 by calebthompson (2012-06-29 20:41:12+00:00)
Title: Add #autosave to AssociationMatcher

has_one, has_many, belongs_to, and has_and_belongs_to_many relationships
can have an `:autosave` option, which causes the relevant associated
records to be automatically saved when their parent is saved.

I've added functionality to test that the association has the correct value for
the :autosave option.

Here's the code for AutosaveAssociation on rails/rails:

https://github.com/rails/rails/blob/master/activerecord/lib/active_record/autosave_association.rb