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

42 lines
1.3 KiB
Gherkin

Feature: Use step definitions generated by factories
Scenario: create a post and verify its attributes
Given the following post exists:
| Title | a fun title |
| Body | here is the content |
Then I should find the following for the last post:
| title | a fun title |
| body | here is the content |
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 | three |
| body | third |
And there should be 3 posts
Scenario: create a post with a new author
Given the following post exists:
| Title | a title |
| Author | ID: 123 |
Then I should find the following for the last post:
| title | a title |
| author_id | 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 | 123 |
| Name | Joe |
And the following post exists:
| Title | a title |
| Author | Name: Joe |
Then I should find the following for the last post:
| title | a title |
| author_id | 123 |
And there should be 1 user