Skip to content

Commit 45d4f3a

Browse files
Add test case for publishing post and updating date behavior (#428)
1 parent 9b4a1d0 commit 45d4f3a

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

features/post.feature

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,3 +438,39 @@ Feature: Manage WordPress posts
438438
"""
439439
0
440440
"""
441+
442+
Scenario: Publishing a post and setting a date fails if the edit_date flag is not passed.
443+
Given a WP install
444+
445+
When I run `wp post create --post_title='test' --porcelain`
446+
Then save STDOUT as {POST_ID}
447+
448+
When I run `wp post update {POST_ID} --post_date='2005-01-24T09:52:00.000Z' --post_status='publish'`
449+
Then STDOUT should contain:
450+
"""
451+
Success:
452+
"""
453+
454+
When I run `wp post get {POST_ID} --field=post_date`
455+
Then STDOUT should not contain:
456+
"""
457+
2005-01-24 09:52:00
458+
"""
459+
460+
Scenario: Publishing a post and setting a date succeeds if the edit_date flag is passed.
461+
Given a WP install
462+
463+
When I run `wp post create --post_title='test' --porcelain`
464+
Then save STDOUT as {POST_ID}
465+
466+
When I run `wp post update {POST_ID} --post_date='2005-01-24T09:52:00.000Z' --post_status='publish' --edit_date=1`
467+
Then STDOUT should contain:
468+
"""
469+
Success:
470+
"""
471+
472+
When I run `wp post get {POST_ID} --field=post_date`
473+
Then STDOUT should contain:
474+
"""
475+
2005-01-24 09:52:00
476+
"""

0 commit comments

Comments
 (0)