1
0
Fork 0
mirror of https://github.com/thoughtbot/factory_bot.git synced 2022-11-09 11:43:51 -05:00
thoughtbot--factory_bot/features/factory_girl_steps.feature

77 lines
2.4 KiB
Gherkin
Raw Normal View History

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:
| 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:
| title | body |
| a fun title | here is the content |
2009-09-15 15:54:21 -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:
| title | body |
| three | third |
2009-09-15 15:54:21 -04:00
And there should be 3 posts
Scenario: create a post with a new author
Given the following post exists:
| Title | Author |
| a title | ID: 123 |
Then I should find the following for the last post:
| title | author_id |
| a title | 123 |
And I should find the following for the last user:
| id |
| 123 |
Scenario: create a post with an existing author
Given the following user exists:
| ID | Name |
| 123 | Joe |
And the following post exists:
| Title | Author |
| a title | Name: Joe |
Then I should find the following for the last post:
| title | author_id |
| a title | 123 |
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 |