james.deville at gmail.com
Thu Jan 10 19:06:56 EST 2008
Speaking for myself, since I support the same philosophy, I wouldn't
test the association. I don't care that it has_many posts. I might
care that I can add multiple posts, or that I can find posts by
criteria, so I would test that.
On Jan 10, 2008, at 4:04 PM, Jonathan Leighton wrote:
> On Thu, 2008-01-10 at 17:59 -0600, David Chelimsky wrote:
>> Another issue is BDD philosophy. BDD is about behaviour. should
>> have_many(:posts) is not behaviour. It is structure. I understand
>> there are people who view this differently, and I would not want to
>> get in the way of anyone using that approach, but RSpec should not be
>> sporting conveniences, even very pragmatic ones, that fundamentally
>> against the grain of BDD.
> Out of interest, how would/do you test associations David? What if
> should have_many(:posts) tested the behaviour of the association
> than whether it's defined?
> Jonathan Leighton
> rspec-users mailing list
> rspec-users at rubyforge.org
More information about the rspec-users