module Shoulda::ActiveRecord::Matchers

def have_many(name)


it { should_have_many(:enemies).dependent(:destroy) }
it { should_have_many(:enemies).through(:friends) }
it { should_have_many(:friends) }
Example:

dependent option.
* dependent - tests that the association makes use of the
* through - association name for has_many :through
Options:

associations.
associated table has the required columns. Works with polymorphic
Ensures that the has_many relationship exists. Will also test that the
def have_many(name)
  AssociationMatcher.new(:has_many, name)
end