mdoel-cukesteps 0.6.0 → 0.6.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 -9
- data/VERSION +1 -1
- data/cukesteps.gemspec +1 -1
- data/lib/cuke_association_helpers.rb +1 -7
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -19,15 +19,19 @@ in concise language. Consider an application with models for restaurant, brand,
|
|
19
19
|
location. Brand instances are pre-seeded into your database (e.g. for dropdown lists and other
|
20
20
|
similar uses). You might want to create a test world like:
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
22
|
+
Scenario: Linked objects with parent object defined first
|
23
|
+
Given the following restaurants exist
|
24
|
+
| restaurant | Location | Brand |
|
25
|
+
| mcd-miami | Miami, fl | McDonalds |
|
26
|
+
| chip-cols | Columbus | Chipotle |
|
27
|
+
Given the following employees exist
|
28
|
+
| name | restaurant |
|
29
|
+
| joe | mcd-miami |
|
30
|
+
| sally | chip-cols |
|
31
|
+
| william | chip-cols |
|
32
|
+
Then 2 restaurants should exist
|
33
|
+
And 3 employees should exist
|
34
|
+
And the "Chipotle" restaurant in "Columbus" has 2 employees
|
31
35
|
|
32
36
|
If you put the following in your features/support/env.rb file:
|
33
37
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.1
|
data/cukesteps.gemspec
CHANGED
@@ -40,18 +40,12 @@ module CukeAssociationHelpers
|
|
40
40
|
if @created_objects[cached_key].nil?
|
41
41
|
attributes[symbolized_key] = build_value(symbolized_key,value)
|
42
42
|
else
|
43
|
-
attributes[symbolized_key] =
|
43
|
+
attributes[symbolized_key] = @created_objects[cached_key][value]
|
44
44
|
end
|
45
45
|
end
|
46
46
|
attributes
|
47
47
|
end
|
48
48
|
|
49
|
-
def saved_objects(klass,value)
|
50
|
-
objects = []
|
51
|
-
value.split(",").each {|o| objects << @created_objects[klass][o]}
|
52
|
-
objects
|
53
|
-
end
|
54
|
-
|
55
49
|
def build_value(key,value)
|
56
50
|
if @@associated_cuke_builders[key].nil?
|
57
51
|
value
|