2009-09-15 15:47:47 -04:00
|
|
|
Feature: Use step definitions generated by factories
|
|
|
|
|
|
|
|
Scenario: create a post and verify its attributes
|
|
|
|
Given the following post exists:
|
2009-09-15 17:38:40 -04:00
|
|
|
| Title | Body |
|
|
|
|
| a fun title | here is the content |
|
2009-09-15 15:47:47 -04:00
|
|
|
Then I should find the following for the last post:
|
2009-09-15 17:38:40 -04:00
|
|
|
| title | body |
|
|
|
|
| a fun title | here is the content |
|
2009-09-15 15:54:21 -04:00
|
|
|
|
2009-09-15 17:58:23 -04:00
|
|
|
Scenario: create a post without a table and verify its attributes
|
|
|
|
Given a post exists with a title of "a fun title"
|
|
|
|
Then I should find the following for the last post:
|
|
|
|
| title |
|
|
|
|
| a fun title |
|
|
|
|
|
|
|
|
Scenario: flexible English when creating posts
|
|
|
|
Given an post exists with an title of "a fun title"
|
|
|
|
Then I should find the following for the last post:
|
|
|
|
| title |
|
|
|
|
| a fun title |
|
|
|
|
|
|
|
|
Scenario: create a post with an underscore in an attribute name
|
|
|
|
Given a post exists with an author ID of "5"
|
|
|
|
Then I should find the following for the last post:
|
|
|
|
| author_id |
|
|
|
|
| 5 |
|
|
|
|
|
2009-09-15 15:54:21 -04:00
|
|
|
Scenario: create several posts
|
|
|
|
Given the following posts exist:
|
|
|
|
| Title | Body |
|
|
|
|
| one | first |
|
|
|
|
| two | second |
|
|
|
|
| three | third |
|
|
|
|
Then I should find the following for the last post:
|
2009-09-15 17:38:40 -04:00
|
|
|
| title | body |
|
|
|
|
| three | third |
|
2009-09-15 15:54:21 -04:00
|
|
|
And there should be 3 posts
|
2009-09-15 16:56:20 -04:00
|
|
|
|
|
|
|
Scenario: create a post with a new author
|
|
|
|
Given the following post exists:
|
2009-09-15 17:38:40 -04:00
|
|
|
| Title | Author |
|
|
|
|
| a title | ID: 123 |
|
2009-09-15 16:56:20 -04:00
|
|
|
Then I should find the following for the last post:
|
2009-09-15 17:38:40 -04:00
|
|
|
| title | author_id |
|
|
|
|
| a title | 123 |
|
2009-09-15 16:56:20 -04:00
|
|
|
And I should find the following for the last user:
|
2009-09-15 17:38:40 -04:00
|
|
|
| id |
|
|
|
|
| 123 |
|
2009-09-15 16:56:20 -04:00
|
|
|
|
|
|
|
Scenario: create a post with an existing author
|
|
|
|
Given the following user exists:
|
2009-09-15 17:38:40 -04:00
|
|
|
| ID | Name |
|
|
|
|
| 123 | Joe |
|
2009-09-15 16:56:20 -04:00
|
|
|
And the following post exists:
|
2009-09-15 17:38:40 -04:00
|
|
|
| Title | Author |
|
|
|
|
| a title | Name: Joe |
|
2009-09-15 16:56:20 -04:00
|
|
|
Then I should find the following for the last post:
|
2009-09-15 17:38:40 -04:00
|
|
|
| title | author_id |
|
|
|
|
| a title | 123 |
|
2009-09-15 16:56:20 -04:00
|
|
|
And there should be 1 user
|
2009-09-15 18:06:24 -04:00
|
|
|
|
|
|
|
Scenario: create a user without attributes
|
|
|
|
Given a user exists
|
|
|
|
Then there should be 1 user
|
|
|
|
|
|
|
|
Scenario: create several users without attributes
|
|
|
|
Given 3 users exist
|
|
|
|
Then there should be 3 users
|
|
|
|
|
|
|
|
Scenario: create several users with one attribute
|
|
|
|
Given 3 users exist with a name of "John"
|
|
|
|
Then there should be 3 users
|
|
|
|
And I should find the following for the last user:
|
|
|
|
| name |
|
|
|
|
| John |
|
2009-09-15 18:11:16 -04:00
|
|
|
|
|
|
|
Scenario: create instances of a factory with an underscore in its name
|
|
|
|
Given an admin user exists with a name of "John"
|
|
|
|
Then I should find the following for the last user:
|
|
|
|
| name | admin |
|
|
|
|
| John | true |
|
|
|
|
|
|
|
|
Scenario: use true values when creating instances
|
|
|
|
Given the following user exists:
|
|
|
|
| name | admin |
|
|
|
|
| Bill | true |
|
|
|
|
Then I should find the following for the last user:
|
|
|
|
| name | admin |
|
|
|
|
| Bill | true |
|
|
|
|
|
|
|
|
Scenario: use false values when creating instances
|
|
|
|
Given the following user exists:
|
|
|
|
| name | admin |
|
|
|
|
| Mike | false |
|
|
|
|
Then I should find the following for the last user:
|
|
|
|
| name | admin |
|
|
|
|
| Mike | false |
|