Hi,<br>
<br>
I&#39;m very new to rspec, so if this is not the right forum please let me know.<br>
<br>
I&#39;m starting to spec my models first in an existing rails app, porting from a mix of Test::Unit, and simply_bdd amongst others.<br>
<br>
I&#39;m at the point where I want to test that certain associations are
present.&nbsp; What I&#39;m not sure of is should I test the association or
the method and return object.<br>
<br>
That is, if I wanted to test a has_many should I:<br>
<br>
Confirm the methods exist, and that the return an array etc<br>
<br>
OR<br>
<br>
Check that the model has the named has_many association through it&#39;s reflections.<br>
<br>
On one hand the second one looks like it will be a bit more robust,
since if there is a has_many relationship, then all the associated
methods may be used througout the app.&nbsp; This would put testing in
the one place.&nbsp; <br>
<br>
On the other hand, this would be really testing the implementation of
the model rather than it&#39;s behaviour.&nbsp;&nbsp; The behaviour is to
call @article.comments and have an array of comments returned.<br>
<br>
Any thoughts?<br>
Cheers<br>
Daniel<br>
<br>