Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Generalize the multiple parented detailed objects feature

  • Loading branch information...
commit bc326807e121fa7efc81ca84fcb823a296d0de37 1 parent 64146d1
@paulelliott authored
View
14 features/active_record_objects.feature
@@ -37,20 +37,6 @@ Feature: Active Record Objects
| 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:
View
13 features/mongoid_objects.feature
@@ -1,13 +0,0 @@
-Feature: Mongoid Objects
-
- Scenario: multiple parented detailed objects
- Given 1 author
- And that author has the following books:
- | title |
- | 1984 |
- | Animal Farm |
- Then I should see 1 author in the database
- And they should be persisted
- And they should reference that author
- And the first should have "1984" for a "title"
- And the second should have "Animal Farm" for a "title"
View
19 features/multiple_parented_detailed_objects.feature
@@ -0,0 +1,19 @@
+Feature: Multiple Parented Detailed Objects
+
+ Scenario Outline:
+ Given 1 <parent fabricator name>
+ And that <parent fabricator name> has the following <child fabricator name>s:
+ | number field |
+ | 20 |
+ | 30 |
+ Then I should see 1 <parent fabricator name> in the database
+ And they should be persisted
+ And they should reference that <parent fabricator name>
+ And the first should have "20" for a "number field"
+ And the second should have "30" for a "number field"
+
+ Scenarios:
+ | parent fabricator name | child fabricator name |
+ | parent active record model | child active record model |
+ | parent mongoid document | referenced mongoid document |
+ | parent sequel model | child sequel model |
View
2  features/step_definitions/object_verification_steps.rb
@@ -48,7 +48,7 @@ def get_class(model_name)
Then /^the ([^"]*) should have "([^"]*)" for a "([^"]*)"$/ do |ordindal, value, field|
object = @they[ORDINALS[ordindal]]
- object.send(field).should == value
+ object.send(dehumanize(field)).to_s.should == value
end
Then /^that ([^"]*) should reference that ([^"]*)$/ do |child_name, parent_name|

0 comments on commit bc32680

Please sign in to comment.
Something went wrong with that request. Please try again.