Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

file 108 lines (97 sloc) 4.051 kb
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
Feature: Active Record Objects

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 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
Something went wrong with that request. Please try again.