paulelliott/fabrication — Issue #89: mongoid 1.6.0 :has_many wrong behaviour
Author: balauru
Created: 2012-02-26 15:02:45+00:00
State: open

Hi,

Using mongoid 1.6.0 and this 2 fabrications:

Fabricator(:judet) do
id BSON::ObjectId.new()
nume Faker::Lorem.words(1)
localitati(:count => 3) { |parent, i| Fabricate(:localitate, :judet => parent) }
end

Fabricator(:localitate) do
id BSON::ObjectId.new()
nume Faker::Lorem.words(1)
end

describe "simple test" do
let(:judet) { Fabricate(:judet) }

it "should pass" do
puts judet.localitati.count.should == 3
end
end