[rspec-users] some fun functionality for all your specs

Courtenay court3nay at gmail.com
Sun Feb 18 00:41:55 EST 2007


On 2/17/07, Graeme Nelson <graeme.nelson at gmail.com> wrote:
> Hi.
>
> I am not sure what the have_valid_associations is really testing.  If
> I have a model, like so:
>
> class Address < ActiveRecord::Base
>    belongs_to :order
> end
>

try this

class Address < ActiveRecord::Base
  belongs_to :fooxl
end

make sure there's no Fooxl model.

the 'valid associations' there means that your association actually
would work, were you to call it.  It's surprising how many
associations don't get tested at the model level.


More information about the rspec-users mailing list