Factory.define :voted_post, :parent => :post, :class => Post do |p|
p.association :votes, :factory => :vote
end
Same as search
some_voted_post.votes = Factory(:vote)
Basically you are trying to assign one vote as an array.
EDIT
You may have an array containing one vote, but you cannot just vote.
This is the difference between:
some_voted_post.votes = Factory(:vote)
and
some_voted_post.votes = [Factory(:vote)]
, , , .