```ruby
# Read about factories at https://github.com/thoughtbot/factory_girl

FactoryGirl.define do
  factory :document do
    sequence(:title) {|n| "Title #{n}"}
    sequence(:body) {|n| "MyText #{n}"}
    versions { [FactoryGirl.build_stubbed(:version)] }
    project
  end
end

```

Replace .build_stubbed with .build in Documents factory
user
```ruby
# Read about factories at https://github.com/thoughtbot/factory_girl

FactoryGirl.define do
  factory :document do
    sequence(:title) {|n| "Title #{n}"}
    sequence(:body) {|n| "MyText #{n}"}
    versions { [FactoryGirl.build(:version)] }
    project
  end
end

```
assistant