factory_girl-cache 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +20 -0
- data/lib/factory_girl-cache/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -100,6 +100,26 @@ More examples:
|
|
100
100
|
FactoryGirlCache.build_list(:post, 2)
|
101
101
|
FactoryGirlCache.build_stubbed(:post)
|
102
102
|
|
103
|
+
#### Store Results From Same Factory for Two Different Associations Separately
|
104
|
+
|
105
|
+
Examples:
|
106
|
+
|
107
|
+
FactoryGirlCache.create(:post, :great_post) # will create
|
108
|
+
FactoryGirlCache.create(:post, :great_post) # will return post from cache
|
109
|
+
FactoryGirlCache.create(:post, :bad_post) # will create
|
110
|
+
FactoryGirlCache.create_list(:post, :great_posts, 2) # will create list of 2
|
111
|
+
FactoryGirlCache.create_list(:post, :bad_posts, 2) # will create list of 2
|
112
|
+
FactoryGirlCache.create_list(:post, :bad_posts, 2) # will return list of 2 from cache
|
113
|
+
FactoryGirlCache.build(:post, :great_post) # will build
|
114
|
+
FactoryGirlCache.build(:post, :great_post) # will return post from cache
|
115
|
+
FactoryGirlCache.build(:post, :bad_post) # will build
|
116
|
+
FactoryGirlCache.build_list(:post, :great_posts, 2) # will build list of 2
|
117
|
+
FactoryGirlCache.build_list(:post, :bad_posts, 2) # will build list of 2
|
118
|
+
FactoryGirlCache.build_list(:post, :bad_posts, 2) # will return list of 2 from cache
|
119
|
+
FactoryGirlCache.build_stubbed(:post, :great_post) # will build stubbed
|
120
|
+
FactoryGirlCache.build_stubbed(:post, :great_post) # will return post from cache
|
121
|
+
FactoryGirlCache.build_stubbed(:post, :bad_post) # will build stubbed
|
122
|
+
|
103
123
|
### License
|
104
124
|
|
105
125
|
Copyright (c) 2012 Gary S. Weaver, released under the [MIT license][lic].
|