FactoryGirl and habtm associations

hi,

Does anyone know whether FactoryGirl is possible to generate a factory
for a model that now HBTM associations and moreover this model requires
the presence of this association.

If possible, would appreciate any information.

The models:

Class Document < Activ…
has_and_belongs_to_many :languages
validate_presences_of :languages
end

Class Language < Active …
has_and_belongs_to_many :documents
end

Thanks.

PS: Sorry for my English.

Hi

     You can use like in document_test

@document = Factory(:document,:languages => [Factory(:language,:name =>
‘English’),Factory(:language,:name => ‘French’)])

 And in this example you have factories/document.rb

Factory.define :language do |l|
l.name “Name here”
end

         There may be some other easy methods also which I am 

unaware of

Sijo

Ok,

A lot of thanks.

Or

“Motes gracies des de BCN” in Catalan.

Bye.