Skip to content

Commit f6e928e

Browse files
committed
Add (failing) test
1 parent 588d8b9 commit f6e928e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

features/post.feature

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,25 @@ Feature: Manage WordPress posts
395395
post-2
396396
"""
397397

398+
Scenario: Creating/updating posts with taxonomies
399+
When I run `wp term create category "First Category" --porcelain`
400+
And save STDOUT as {CAT_1}
401+
And I run `wp term create category "Second Category" --porcelain`
402+
And save STDOUT as {CAT_2}
403+
And I run `wp term create post_tag "Term One" --porcelain`
404+
And I run `wp term create post_tag "Term Two" --porcelain`
405+
When I run `wp post create --post_title='Test Post' --post_content='Test post content' --tax_input='{"category":[{CAT_1},{CAT_2}],"post_tag":["term-one", "term-two"]}' --porcelain`
406+
Then STDOUT should be a number
407+
And save STDOUT as {POST_ID}
408+
409+
When I run `wp post term list {POST_ID} category post_tag --format=table --fields=name,taxonomy`
410+
Then STDOUT should be a table containing rows:
411+
| name | taxonomy |
412+
| First Category | category |
413+
| Second Category | category |
414+
| Term One | post_tag |
415+
| Term Two | post_tag |
416+
398417
Scenario: Update categories on a post
399418
When I run `wp term create category "Test Category" --porcelain`
400419
Then save STDOUT as {TERM_ID}

0 commit comments

Comments
 (0)