README.md in factory_girl-preload-2.3.0 vs README.md in factory_girl-preload-2.3.1
- old
+ new
@@ -85,10 +85,30 @@
factory(:myapp) { Factory(:project, user: users(:john)) }
end
end
```
+You can also use preloaded factories on factory definitions.
+
+```ruby
+FactoryGirl.define do
+ factory :user do
+ # ...
+ end
+
+ factory :projects do
+ name "My Project"
+ user { users(:john) }
+ end
+
+ preload do
+ factory(:john) { Factory(:user) }
+ factory(:myapp) { Factory(:project, user: users(:john)) }
+ end
+end
+```
+
Like Rails fixtures, FGP will define methods for each model. You can use it on your examples and alike.
```ruby
require "spec_helper"
@@ -105,14 +125,14 @@
end
```
Easy and, probably, faster!
-== Maintainer
+## Maintainer
* Nando Vieira (http://nandovieira.com.br)
-== License
+## License
(The MIT License)
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the