This repository has been archived by the owner on Mar 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 97
/
active_record_objects.feature
177 lines (158 loc) · 6.31 KB
/
active_record_objects.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
Feature: Active Record Objects
Scenario: some generic objects
Given 5 divisions
Then I should see 5 divisions in the database
Scenario: a single detailed object
Given the following division:
| name | Rasczak's Roughnecks |
Then I should see 1 division in the database
And I should see the following division in the database:
| name | Rasczak's Roughnecks |
Scenario: multiple detailed objects
Given the following divisions:
| name |
| Red Squadron |
| Yellow Squadron |
Then I should see 2 divisions in the database
And I should see the following division in the database:
| name | Red Squadron |
And I should see the following division in the database:
| name | Yellow Squadron |
Scenario: a single object with transform to apply
Given the following company:
| name | Widgets Inc |
Given the following division:
| name | Southwest |
| company | Widgets Inc |
Then that division should reference that company
Scenario: multiple objects with transform to apply
Given the following company:
| name | Widgets Inc |
Given the following divisions:
| name | company |
| Southwest | Widgets Inc |
| North | Widgets Inc |
Then they should reference that company
Scenario: a parented single generic object
Given 1 company
And that company has 1 division
Then I should see 1 company in the database
And I should see 1 division in the database
Scenario: a parented single detailed object
Given 1 company
And that company has the following division:
| name | Everyone |
Then I should see 1 company in the database
And I should see 1 division in the database
And I should see the following division in the database:
| name | Everyone |
And that division should reference that company
Scenario: a parented single detailed object with inheritance
Given 1 company
And that company has the following squadron:
| name | Everyone |
Then I should see 1 company in the database
And I should see 1 squadron in the database
And I should see the following division in the database:
| name | Everyone |
And that squadron should reference that company
Scenario: a parented single detailed object whose parent has inheritance
Given 1 startup
And that startup has the following division:
| name | Everyone |
Then I should see 1 startup in the database
And I should see 1 division in the database
And I should see the following division in the database:
| name | Everyone |
And that division should reference that startup
Scenario: multiple parented detailed objects
Given 1 company
And that company has the following divisions:
| name |
| Red Squadron |
| Yellow Squadron |
Then I should see 1 company in the database
And I should see 2 divisions in the database
And I should see the following division in the database:
| name | Red Squadron |
And I should see the following division in the database:
| name | Yellow Squadron |
And they should reference that company
Scenario: multiple parented detailed objects with inheritance
Given 1 company
And that company has the following squadrons:
| name |
| Red Squadron |
| Yellow Squadron |
Then I should see 1 company in the database
And I should see 2 squadrons in the database
And I should see the following division in the database:
| name | Red Squadron |
And I should see the following division in the database:
| name | Yellow Squadron |
And they should reference that company
Scenario: multiple parented detailed objects whose parent has inheritance
Given 1 startup
And that startup has the following divisions:
| name |
| Red Squadron |
| Yellow Squadron |
Then I should see 1 startup in the database
And I should see 2 divisions in the database
And I should see the following division in the database:
| name | Red Squadron |
And I should see the following division in the database:
| name | Yellow Squadron |
And they should reference that startup
Scenario: a generic parent from the child
Given 1 division
And that division has 1 company
Then I should see 1 division in the database
And I should see 1 company in the database
And that division should reference that company
Scenario: a detailed parent from the child
Given 1 division
And that division has the following company:
| name | Hashrocket |
Then I should see 1 division in the database
And I should see 1 company in the database
And I should see the following company in the database:
| name | Hashrocket |
And that division should reference that company
Scenario: a parent with inheritance from the child
Given 1 division
And that division has the following startup:
| name | Hashrocket |
Then I should see 1 startup in the database
And I should see 1 division in the database
And I should see the following company in the database:
| name | Hashrocket |
And that division should reference that startup
Scenario: a child belongs to a parent
Given 1 company
And 1 division
And that division belongs to that company
Then I should see 1 division in the database
And I should see 1 company in the database
And that division should reference that company
Scenario: an inherited child belongs to a parent
Given 1 company
And 1 squadron
And that squadron belongs to that company
Then I should see 1 squadron in the database
And I should see 1 company in the database
And that squadron should reference that company
Scenario: a child belongs to an inherited parent
Given 1 startup
And 1 division
And that division belongs to that startup
Then I should see 1 division in the database
And I should see 1 startup in the database
And that division should reference that startup
Scenario: children belong to a parent
Given 1 company
And 2 divisions
And those divisions belong to that company
Then I should see 1 company in the database
And I should see 2 divisions in the database
And they should reference that company