factory_bot 1.0.0.alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. checksums.yaml +7 -0
  2. data/.autotest +9 -0
  3. data/.gitignore +9 -0
  4. data/.rspec +2 -0
  5. data/.simplecov +4 -0
  6. data/.travis.yml +41 -0
  7. data/.yardopts +5 -0
  8. data/Appraisals +19 -0
  9. data/CONTRIBUTING.md +60 -0
  10. data/GETTING_STARTED.md +1387 -0
  11. data/Gemfile +8 -0
  12. data/Gemfile.lock +123 -0
  13. data/LICENSE +19 -0
  14. data/NAME.md +11 -0
  15. data/NEWS +285 -0
  16. data/README.md +102 -0
  17. data/Rakefile +36 -0
  18. data/cucumber.yml +1 -0
  19. data/factory_bot.gemspec +38 -0
  20. data/factory_girl.gemspec +41 -0
  21. data/gemfiles/3.2.gemfile +10 -0
  22. data/gemfiles/3.2.gemfile.lock +112 -0
  23. data/gemfiles/4.0.gemfile +10 -0
  24. data/gemfiles/4.0.gemfile.lock +112 -0
  25. data/gemfiles/4.1.gemfile +10 -0
  26. data/gemfiles/4.1.gemfile.lock +111 -0
  27. data/gemfiles/4.2.gemfile +10 -0
  28. data/gemfiles/4.2.gemfile.lock +111 -0
  29. data/gemfiles/5.0.gemfile +10 -0
  30. data/gemfiles/5.0.gemfile.lock +110 -0
  31. data/lib/factory_bot.rb +154 -0
  32. data/lib/factory_bot/aliases.rb +18 -0
  33. data/lib/factory_bot/attribute.rb +62 -0
  34. data/lib/factory_bot/attribute/association.rb +27 -0
  35. data/lib/factory_bot/attribute/dynamic.rb +24 -0
  36. data/lib/factory_bot/attribute/sequence.rb +16 -0
  37. data/lib/factory_bot/attribute/static.rb +16 -0
  38. data/lib/factory_bot/attribute_assigner.rb +97 -0
  39. data/lib/factory_bot/attribute_list.rb +67 -0
  40. data/lib/factory_bot/callback.rb +40 -0
  41. data/lib/factory_bot/callbacks_observer.rb +21 -0
  42. data/lib/factory_bot/configuration.rb +37 -0
  43. data/lib/factory_bot/declaration.rb +23 -0
  44. data/lib/factory_bot/declaration/association.rb +28 -0
  45. data/lib/factory_bot/declaration/dynamic.rb +26 -0
  46. data/lib/factory_bot/declaration/implicit.rb +33 -0
  47. data/lib/factory_bot/declaration/static.rb +26 -0
  48. data/lib/factory_bot/declaration_list.rb +49 -0
  49. data/lib/factory_bot/decorator.rb +21 -0
  50. data/lib/factory_bot/decorator/attribute_hash.rb +16 -0
  51. data/lib/factory_bot/decorator/class_key_hash.rb +28 -0
  52. data/lib/factory_bot/decorator/disallows_duplicates_registry.rb +13 -0
  53. data/lib/factory_bot/decorator/invocation_tracker.rb +19 -0
  54. data/lib/factory_bot/decorator/new_constructor.rb +12 -0
  55. data/lib/factory_bot/definition.rb +136 -0
  56. data/lib/factory_bot/definition_hierarchy.rb +48 -0
  57. data/lib/factory_bot/definition_proxy.rb +174 -0
  58. data/lib/factory_bot/errors.rb +25 -0
  59. data/lib/factory_bot/evaluation.rb +23 -0
  60. data/lib/factory_bot/evaluator.rb +82 -0
  61. data/lib/factory_bot/evaluator_class_definer.rb +20 -0
  62. data/lib/factory_bot/factory.rb +162 -0
  63. data/lib/factory_bot/factory_runner.rb +33 -0
  64. data/lib/factory_bot/find_definitions.rb +25 -0
  65. data/lib/factory_bot/linter.rb +97 -0
  66. data/lib/factory_bot/null_factory.rb +18 -0
  67. data/lib/factory_bot/null_object.rb +24 -0
  68. data/lib/factory_bot/registry.rb +38 -0
  69. data/lib/factory_bot/reload.rb +8 -0
  70. data/lib/factory_bot/sequence.rb +62 -0
  71. data/lib/factory_bot/strategy/attributes_for.rb +13 -0
  72. data/lib/factory_bot/strategy/build.rb +15 -0
  73. data/lib/factory_bot/strategy/create.rb +18 -0
  74. data/lib/factory_bot/strategy/null.rb +11 -0
  75. data/lib/factory_bot/strategy/stub.rb +108 -0
  76. data/lib/factory_bot/strategy_calculator.rb +26 -0
  77. data/lib/factory_bot/strategy_syntax_method_registrar.rb +54 -0
  78. data/lib/factory_bot/syntax.rb +7 -0
  79. data/lib/factory_bot/syntax/default.rb +76 -0
  80. data/lib/factory_bot/syntax/methods.rb +111 -0
  81. data/lib/factory_bot/syntax_runner.rb +6 -0
  82. data/lib/factory_bot/trait.rb +30 -0
  83. data/lib/factory_bot/version.rb +3 -0
  84. data/lib/factory_girl.rb +5 -0
  85. data/lib/factory_girl/version.rb +1 -0
  86. metadata +302 -0
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec name: 'factory_bot'
4
+
5
+ gem 'activerecord-jdbcsqlite3-adapter', platforms: :jruby
6
+ gem 'jdbc-sqlite3', platforms: :jruby
7
+
8
+ gem 'sqlite3', '~> 1.3.10', platforms: :ruby
data/Gemfile.lock ADDED
@@ -0,0 +1,123 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ factory_bot (1.0.0)
5
+ activesupport (>= 3.0.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ activemodel (5.0.0.1)
11
+ activesupport (= 5.0.0.1)
12
+ activerecord (5.0.0.1)
13
+ activemodel (= 5.0.0.1)
14
+ activesupport (= 5.0.0.1)
15
+ arel (~> 7.0)
16
+ activerecord-jdbc-adapter (1.3.21)
17
+ activerecord (>= 2.2)
18
+ activerecord-jdbcsqlite3-adapter (1.3.21)
19
+ activerecord-jdbc-adapter (~> 1.3.21)
20
+ jdbc-sqlite3 (>= 3.7.2, < 3.9)
21
+ activesupport (5.0.0.1)
22
+ concurrent-ruby (~> 1.0, >= 1.0.2)
23
+ i18n (~> 0.7)
24
+ minitest (~> 5.1)
25
+ tzinfo (~> 1.1)
26
+ appraisal (2.1.0)
27
+ bundler
28
+ rake
29
+ thor (>= 0.14.0)
30
+ arel (7.1.4)
31
+ aruba (0.13.0)
32
+ childprocess (~> 0.5.6)
33
+ contracts (~> 0.9)
34
+ cucumber (>= 1.3.19)
35
+ ffi (~> 1.9.10)
36
+ rspec-expectations (>= 2.99)
37
+ thor (~> 0.19)
38
+ bourne (1.6.0)
39
+ mocha (~> 1.1)
40
+ builder (3.2.2)
41
+ childprocess (0.5.9)
42
+ ffi (~> 1.0, >= 1.0.11)
43
+ concurrent-ruby (1.0.2)
44
+ concurrent-ruby (1.0.2-java)
45
+ contracts (0.13.0)
46
+ cucumber (1.3.20)
47
+ builder (>= 2.1.2)
48
+ diff-lcs (>= 1.1.3)
49
+ gherkin (~> 2.12)
50
+ multi_json (>= 1.7.5, < 2.0)
51
+ multi_test (>= 0.1.2)
52
+ diff-lcs (1.2.5)
53
+ docile (1.1.5)
54
+ ffi (1.9.10)
55
+ ffi (1.9.10-java)
56
+ gherkin (2.12.2)
57
+ multi_json (~> 1.3)
58
+ gherkin (2.12.2-java)
59
+ multi_json (~> 1.3)
60
+ i18n (0.7.0)
61
+ jdbc-sqlite3 (3.8.11.2)
62
+ json (1.8.3)
63
+ json (1.8.3-java)
64
+ metaclass (0.0.4)
65
+ minitest (5.9.1)
66
+ mocha (1.1.0)
67
+ metaclass (~> 0.0.1)
68
+ multi_json (1.11.2)
69
+ multi_test (0.1.2)
70
+ rake (10.5.0)
71
+ rspec (3.4.0)
72
+ rspec-core (~> 3.4.0)
73
+ rspec-expectations (~> 3.4.0)
74
+ rspec-mocks (~> 3.4.0)
75
+ rspec-core (3.4.2)
76
+ rspec-support (~> 3.4.0)
77
+ rspec-expectations (3.4.0)
78
+ diff-lcs (>= 1.2.0, < 2.0)
79
+ rspec-support (~> 3.4.0)
80
+ rspec-its (1.2.0)
81
+ rspec-core (>= 3.0.0)
82
+ rspec-expectations (>= 3.0.0)
83
+ rspec-mocks (3.4.1)
84
+ diff-lcs (>= 1.2.0, < 2.0)
85
+ rspec-support (~> 3.4.0)
86
+ rspec-support (3.4.1)
87
+ simplecov (0.11.2)
88
+ docile (~> 1.1.0)
89
+ json (~> 1.8)
90
+ simplecov-html (~> 0.10.0)
91
+ simplecov-html (0.10.0)
92
+ sqlite3 (1.3.12)
93
+ thor (0.19.1)
94
+ thread_safe (0.3.5)
95
+ thread_safe (0.3.5-java)
96
+ timecop (0.8.0)
97
+ tzinfo (1.2.2)
98
+ thread_safe (~> 0.1)
99
+ yard (0.8.7.6)
100
+
101
+ PLATFORMS
102
+ java
103
+ ruby
104
+
105
+ DEPENDENCIES
106
+ activerecord (>= 3.0.0)
107
+ activerecord-jdbcsqlite3-adapter
108
+ appraisal (~> 2.1.0)
109
+ aruba
110
+ bourne
111
+ cucumber (~> 1.3.15)
112
+ factory_bot!
113
+ jdbc-sqlite3
114
+ mocha (>= 0.12.8)
115
+ rspec (~> 3.0)
116
+ rspec-its (~> 1.0)
117
+ simplecov
118
+ sqlite3 (~> 1.3.10)
119
+ timecop
120
+ yard
121
+
122
+ BUNDLED WITH
123
+ 1.13.6
data/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2008-2016 Joe Ferris and thoughtbot, inc.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
data/NAME.md ADDED
@@ -0,0 +1,11 @@
1
+ # Why is this project called "Factory Girl"?
2
+
3
+ The name "Factory Girl" might be confusing to some developers who encounter this
4
+ library.
5
+
6
+ [We chose the name](https://robots.thoughtbot.com/waiting-for-a-factory-girl) as
7
+ a nod in the direction of the [Factory method](https://en.wikipedia.org/wiki/Factory_method_pattern)
8
+ and [Object Mother](http://martinfowler.com/bliki/ObjectMother.html) software
9
+ patterns from the _Design Patterns_ book, and as a reference to the
10
+ [Rolling Stones song](https://www.youtube.com/watch?v=4jKix2DFlnA) of the same
11
+ name.
data/NEWS ADDED
@@ -0,0 +1,285 @@
1
+ 4.8.0 (December 16, 2016)
2
+ Improve documentation
3
+ Add `FactoryGirl.generate_list` to be consistent with `build_list`/`create_list` and friends
4
+ Add `FactoryGirl.use_parent_strategy` configuration to allow associations to leverage parent build strategy
5
+
6
+ 4.7.0 (April 1, 2016)
7
+ Improve documentation
8
+ Improve instrumentation payload to include traits, overrides, and the factory itself
9
+ Allow linting of traits
10
+ Deprecate factory lookup by class name in preparation for 5.0
11
+ Improve internal performance by using flat_map instead of map and compact
12
+ Improve handling of dirty attributes after building a stubbed object
13
+ Reduce warnings from redefining methods
14
+
15
+ 4.6.0 (skipped)
16
+
17
+ 4.5.0 (October 17, 2014)
18
+ Improve FactoryBot.lint by including exception and message in output
19
+ Allow selective linting
20
+ Use more explicit #public_send when doing attribute assignment
21
+ Improve documentation around FactoryBot.lint and initialize_with
22
+ Deprecate #ignore in favor of #transient
23
+
24
+ 4.4.0 (February 10, 2014)
25
+ Add FactoryBot.lint
26
+ Fix memory leak in duplicate traits
27
+ Update documentation
28
+
29
+ 4.3.0 (November 3, 2013)
30
+ Start testing against Rails 4.0 and Ruby 2.0.0
31
+ Stop testing against Rails 3.0 and Ruby 1.9.2
32
+ Add *_pair methods to only build two objects
33
+ Raise if a method is defined with a FactoryBot block (factory or trait)
34
+ Allow use of Symbol#to_proc in callbacks
35
+ Add global callbacks
36
+ Improve GETTING_STARTED and README
37
+
38
+ 4.2.0 (January 18, 2013)
39
+ Improve documentation
40
+ Allow *_list syntax methods to accept a block
41
+ Update gem dependencies
42
+ Allow setting id for objects created with `build_stubbed`
43
+ Fix Stub strategy to mimic ActiveRecord regarding `created_at`
44
+ Evaluate sequences within the context of an Evaluator
45
+ Fix Mocha deprecation warning
46
+ Fix some warnings when running RUBYOPT=-w rake
47
+ Convert test suite to RSpec's "expect" syntax
48
+
49
+ 4.1.0 (September 11, 2012)
50
+ Allow multiple callbacks to bind to the same block
51
+ Fix documentation surrounding the stub strategy
52
+
53
+ 4.0.0 (August 3, 2012)
54
+ Remove deprecated cucumber_steps
55
+ Remove deprecated alternate syntaxes
56
+ Deprecate duplicate_attribute_assignment_from_initialize_with, which is now unused
57
+ as attributes assigned within initialize_with are not subsequently assigned
58
+
59
+ 3.6.1 (August 2, 2012)
60
+ Update README to include info about running with JRuby
61
+ Update dependencies on RSpec and tiny versions of Rails in Appraisal
62
+ Improve flexibility of using traits with associations and add documentation
63
+ Stub update_column to raise to mirror ActiveRecord's change from update_attribute
64
+
65
+ 3.6.0 (July 27, 2012)
66
+ Code/spec cleanup
67
+ Allow factories with traits to be used in associations
68
+ Refactor Factory to use DefinitionHierarchy to handle managing callbacks,
69
+ custom constructor, and custom to_create
70
+ Add memoization to speed up factories providing attribute overrides
71
+ Add initial support of JRuby when running in 1.9 mode
72
+ Improve docs on what happens when including FactoryBot::Syntax::Methods
73
+
74
+ 3.5.0 (June 22, 2012)
75
+ Allow created_at to be set when using build_stubbed
76
+ Deprecate FactoryBot step definitions
77
+
78
+ 3.4.2 (June 19, 2012)
79
+ Fix bug in traits with callbacks called implicitly in factories whose
80
+ callbacks trigger multiple times
81
+
82
+ 3.4.1 (June 18, 2012)
83
+ Fix traits so they can be nested and referred to from other traits
84
+
85
+ 3.4.0 (June 11, 2012)
86
+ Sequences support Enumerators
87
+ Optionally disable duplicate assignment of attributes in initialize_with
88
+ Make hash of public attributes available in initialize_with
89
+ Support referring to a factory based on class name
90
+
91
+ 3.3.0 (May 13, 2012)
92
+ Allow to_create, skip_create, and initialize_with to be defined globally
93
+ Allow to_create, skip_create, and initialize_with to be defined within traits
94
+ Fix deprecation messages for alternate syntaxes (make, generate, etc.)
95
+ Improve library documentation
96
+ Deprecate after_build, after_create, before_create, after_stub in favor of new callbacks
97
+ Introduce new callback syntax: after(:build) {}, after(:custom) {}, or callback(:different) {}
98
+ This allows for declaring any callback, usable with custom strategies
99
+ Add attributes_for_list and build_stubbed_list with the StrategySyntaxMethodRegistrar
100
+ Allow use of syntax methods (build, create, generate, etc) implicitly in callbacks
101
+ Internal refactoring of a handful of components
102
+
103
+ 3.2.0 (April 24, 2012)
104
+ Use AS::Notifications for pub/sub to track running factories
105
+ Call new within initialize_with implicitly on the build class
106
+ Skip to_create with skip_create
107
+ Allow registration of custom strategies
108
+ Deprecate alternate syntaxes
109
+ Implicitly call factory_bot's syntax methods from dynamic attributes
110
+
111
+ 3.1.0 (April 6, 2012)
112
+ Sequences support aliases, which reference the same block
113
+ Update documentation
114
+ Add before_create callback
115
+ Support use of #attribute_names method to determine available attributes for steps
116
+ Use ActiveSupport::Deprecation for all deprecations
117
+
118
+ 3.0.0 (March 23, 2012)
119
+ Deprecate the vintage syntax
120
+ Remove Rails 2.x support
121
+ Remove Ruby 1.8 support
122
+ Remove deprecated features, including default_strategy, factory_name,
123
+ :method for defining default strategy, ignore on individual attributes, and
124
+ interacting with Factory the way you would FactoryBot
125
+
126
+ 2.6.4 (March 16, 2012)
127
+ Do not ignore names of transient attributes
128
+ Ensure attributes set on instance are calculated uniquely
129
+
130
+ 2.6.3 (March 9, 2012)
131
+ Fix issue with traits not being present the first time a factory is accessed
132
+ Update available Cucumber step definitions to not require a trailing colon
133
+ when building a table of attributes to instantiate records with
134
+
135
+ 2.6.2 (March 9, 2012)
136
+ Allow factories to use all their ancestors' traits
137
+ Ignore bin dir generated by bundler
138
+ Namespace ::Factory as top-level to fix vintage syntax issue with
139
+ Ruby 1.9.2-p3p18
140
+
141
+ 2.6.1 (March 2, 2012)
142
+ Use FactoryBot.reload in specs
143
+ Clean up running named factories with a particular strategy with
144
+ FactoryBot::FactoryRunner
145
+
146
+ 2.6.0 (February 17, 2012)
147
+ Improve documentation of has_many associations in the GETTING_STARTED
148
+ document
149
+ Deprecate :method in favor of :strategy when overriding an association's
150
+ build strategy
151
+
152
+ 2.5.2 (February 10, 2012)
153
+ Fix step definitions to use associations defined in parent factories
154
+ Add inline trait support to (build|create)_list
155
+ Update ActiveSupport dependency to >= 2.3.9, which introduced
156
+ class_attribute
157
+
158
+ 2.5.1 (February 3, 2012)
159
+ Fix attribute evaluation when the attribute isn't defined in the factory but
160
+ is a private method on Object
161
+ Update rubygems on Travis before running tests
162
+ Fix spec name
163
+ Update GETTING_STARTED with correct usage of build_stubbed
164
+ Update README with more info on initialize_with
165
+ Honor :parent on factory over block nesting
166
+
167
+ 2.5.0 (January 20, 2012)
168
+ Revert 'Deprecate build_stubbed and attributes_for'
169
+ Implement initialize_with to allow overriding object instantiation
170
+ Ensure FG runs against Rails 3.2.0
171
+
172
+ 2.4.2 (January 18, 2012)
173
+ Fix inline traits' interaction with defaults on the factory
174
+
175
+ 2.4.1 (January 17, 2012)
176
+ Deprecate build_stubbed and attributes_for
177
+ Fix inline traits
178
+
179
+ 2.4.0 (January 13, 2012)
180
+ Refactor internals of FactoryBot to use anonymous class on which attributes
181
+ get defined
182
+ Explicitly require Ruby 1.8.7 or higher in gemspec
183
+ Fix documentation
184
+ Add Gemnasium status to documentation
185
+ Supplying a Class to a factory that overrides to_s no longer results in
186
+ getting the wrong Class constructed
187
+ Be more agnostic about ORMs when using columns in FactoryBot step
188
+ definitions
189
+ Test against Active Record 3.2.0.rc2
190
+ Update GETTING_STARTED to use Ruby syntax highlighting
191
+
192
+ 2.3.2 (November 26, 2011)
193
+ Move logic of where instance.save! is set to Definition
194
+ Fix method name from aliases_for? to alias_for?
195
+ Refactor internal attribute handling to use an anonymous class instead of
196
+ faking Ruby's variable resolution. This allows for more sane usage of
197
+ attributes without having to manage sorting priority because attributes
198
+ can turn themselves into procs, which are used with define_method on a
199
+ class so attributes work correctly all the time.
200
+
201
+ 2.3.1 (November 23, 2011)
202
+ Remove internally-used associate method from all the FactoryBot::Proxy subclasses
203
+ Move around requiring of files
204
+ Consolidate errors into factory_bot.rb
205
+ Refactor AttributeList to deal with priority only when iterating over
206
+ attributes
207
+ Refactor internals of some of the Proxy subclasses
208
+ Ensure callbacks on traits are executed in the correct order
209
+
210
+ 2.3.0 (November 18, 2011)
211
+ Registries are named, resulting in better messages when factories, traits,
212
+ or sequences cannot be found
213
+ Fix incorrect tests
214
+ Internals refactoring introducing FactoryBot::NullFactory,
215
+ FactoryBot::Definition, and FactoryBot::DeclarationList
216
+ Use ActiveSupport for Hash#except and its delegation capabilities
217
+ Fix usage of callbacks when added via implicit traits
218
+ Use Bundler tasks and clean up dependencies
219
+ Fix failing spec for big letters in factory name passed as symbol
220
+ Add ability for traits to be added dynamically when creating an instance via
221
+ build, create, build_stubbed, or attributes_for
222
+
223
+ 2.2.0 (October 14, 2011)
224
+ Clean up RSpec suite to not use 'should'
225
+ Use create_list in step definitions
226
+ Syntax methods that deal with ORM interaction (attributes_for, build, build_stubbed,
227
+ and create) now accept a block that yields the result. This results in a
228
+ more convenient way to interact with the result than using Object.tap.
229
+ Standardize deprecation warnings
230
+ Update transient attribute syntax to use blocks instead of calling ignore on
231
+ each attribute declaration
232
+ Parents can be defined after children because factories are evaluated when
233
+ they're used; this means breaking up factories across multiple files will
234
+ behave as expected
235
+ Large internal refactoring, including changing access modifiers for a
236
+ handful of methods for a more clearly defined API
237
+
238
+ 2.1.2 (September 23, 2011)
239
+ Bugfix: Vintage syntax fixed after bug introduced in 2.1.1
240
+ Introduce dependency on activesupport to remove code from Factory class
241
+
242
+ 2.1.1 (September 23, 2011) (yanked)
243
+ Bugfix: Parent object callbacks are run before child object callbacks
244
+ Declarations: allow overriding/modification of individual traits in child factories
245
+ Callbacks refactored to not be attributes
246
+ Updating documentation for formatting and clarity (incl. new specificity for cucumber)
247
+
248
+ 2.1.0 (September 02, 2011)
249
+ Bugfix: created_at now defined for stubbed models
250
+ Gemspec updated for use with Rails 3.1
251
+ Factories can now be modified post-definition (useful for overriding defaults from gems/plugins)
252
+ All factories can now be reloaded with Factory.reload
253
+ Add :method => build to factory associations to prevent saving of associated objects
254
+ Factories defined in {Rails.root}/factories are now loaded by default
255
+ Various documentation updates
256
+
257
+ 1.1.4 (November 28, 2008)
258
+ Factory.build now uses Factory.create for associations of the built object
259
+ Factory definitions are now detected in subdirectories, such as
260
+ factories/person_factory.rb (thanks to Josh Nichols)
261
+ Factory definitions are now loaded after the environment in a Rails project
262
+ (fixes some issues with dependencies being loaded too early) (thanks to
263
+ Josh Nichols)
264
+ Factory names ending in 's' no longer cause problems (thanks to Alex Sharp
265
+ and Josh Owens)
266
+
267
+ 1.1.3 (September 12, 2008)
268
+ Automatically pull in definitions from factories.rb, test/factories.rb, or
269
+ spec/factories.rb
270
+ 1.1.2 (July 30, 2008)
271
+ Improved error handling for invalid and undefined factories/attributes
272
+ Improved handling of strings vs symbols vs classes
273
+ Added a prettier syntax for handling associations
274
+ Updated documentation and fixed compatibility with Rails 2.1
275
+
276
+ 1.1.1 (June 23, 2008)
277
+ The attribute "name" no longer requires using #add_attribute
278
+
279
+ 1.1.0 (June 03, 2008)
280
+ Added support for dependent attributes
281
+ Fixed the attributes_for build strategy to not build associations
282
+ Added support for sequences
283
+
284
+ 1.0.0 (May 31, 2008)
285
+ First version