factory_seed 0.1.0 → 0.1.1
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.
- data/README.rdoc +13 -0
- data/lib/factory_seed.rb +1 -0
- data/lib/seed/version.rb +1 -1
- data/test/seed_test.rb +6 -0
- metadata +4 -3
data/README.rdoc
CHANGED
@@ -53,6 +53,19 @@ You can define the associations by providing a hash.
|
|
53
53
|
@user = _1_user
|
54
54
|
_10_comments(:user => @user)
|
55
55
|
|
56
|
+
In fact, you can set any attribute by providing this hash.
|
57
|
+
|
58
|
+
@user = _1_user(:username => "johndoe")
|
59
|
+
|
60
|
+
If you need to set attributes from multiple factories, the best approach is to break into several calls.
|
61
|
+
|
62
|
+
@user = _1_user(:username => "johndoe")
|
63
|
+
@comments = _10_messages(:user => @user, :subject => "Welcome to our App")
|
64
|
+
|
65
|
+
The +seed+ method can receive a hash as well.
|
66
|
+
|
67
|
+
@user = seed("1 user", :username => "johndoe")
|
68
|
+
|
56
69
|
= Using with Test::Unit
|
57
70
|
|
58
71
|
Just include the +Seed+ module.
|
data/lib/factory_seed.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "seed"
|
data/lib/seed/version.rb
CHANGED
data/test/seed_test.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 1
|
9
|
+
version: 0.1.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Nando Vieira
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-03-
|
17
|
+
date: 2010-03-29 00:00:00 -03:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -39,6 +39,7 @@ extra_rdoc_files:
|
|
39
39
|
- README.rdoc
|
40
40
|
files:
|
41
41
|
- README.rdoc
|
42
|
+
- lib/factory_seed.rb
|
42
43
|
- lib/seed.rb
|
43
44
|
- lib/seed/version.rb
|
44
45
|
- test/resources/factories.rb
|