thoughtbot/shoulda-matchers — pull request #208 by cbandy (2012-12-21 06:39:24+00:00)
Title: Resolve class name in AssociationMatcher

I want to assert that my relationships *behave* correctly, not that I typed them a certain way.

This changes the behavior of the `class_name` option of `AssociationMatcher` to assert on the name of the other model rather than the value passed in the association definition. Now the following works:

```ruby
module Some
class Person < ActiveRecord::Base
has_many :children
end

class Child < ActiveRecord::Base
belongs_to :person
end
end

describe Some::Person do
it { should have_many(:children).class_name('Some::Child') }
end

describe Some::Child do
it { should belong_to(:person).class_name('Some::Person') }
end
```