Skip to content

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
i-am-chitti committed Apr 26, 2024
1 parent 62861bc commit d7235c8
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions features/site-generate.feature
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Feature: Generate new WordPress sites
When I try `wp site generate --count=4 --network_id=2`
Then STDERR should contain:
"""
Network with id 2 does not exist.
Network with id 2 does not exist.
"""
And STDOUT should be empty
And the return code should be 1
Expand Down Expand Up @@ -72,4 +72,31 @@ Feature: Generate new WordPress sites
Then STDOUT should be:
"""
1 2
"""
"""

Scenario: Generate sites with a slug
Given a WP multisite subdirectory install
When I run `wp site generate --count=2 --slug=subsite`
Then STDOUT should be empty

When I run `wp site list --fields=blog_id,url`
Then STDOUT should be a table containing rows:
| blog_id | url |
| 1 | https://example.com/ |
| 2 | https://example.com/subsite1/ |
| 3 | https://example.com/subsite2/ |
When I run `wp site list --format=ids`
Then STDOUT should be:
"""
1 2 3
"""

Scenario: Generate sites with reserved slug
Given a WP multisite subdirectory install
When I try `wp site generate --count=2 --slug=page`
Then STDERR should contain:
"""
The following words are reserved and cannot be used as blog names: page, comments, blog, files, feed
"""
And STDOUT should be empty
And the return code should be 1

0 comments on commit d7235c8

Please sign in to comment.