Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions features/post.feature
Original file line number Diff line number Diff line change
Expand Up @@ -438,3 +438,39 @@ Feature: Manage WordPress posts
"""
0
"""

Scenario: Publishing a post and setting a date fails if the edit_date flag is not passed.
Given a WP install

When I run `wp post create --post_title='test' --porcelain`
Then save STDOUT as {POST_ID}

When I run `wp post update {POST_ID} --post_date='2005-01-24T09:52:00.000Z' --post_status='publish'`
Then STDOUT should contain:
"""
Success:
"""

When I run `wp post get {POST_ID} --field=post_date`
Then STDOUT should not contain:
"""
2005-01-24 09:52:00
"""

Scenario: Publishing a post and setting a date succeeds if the edit_date flag is passed.
Given a WP install

When I run `wp post create --post_title='test' --porcelain`
Then save STDOUT as {POST_ID}

When I run `wp post update {POST_ID} --post_date='2005-01-24T09:52:00.000Z' --post_status='publish' --edit_date=1`
Then STDOUT should contain:
"""
Success:
"""

When I run `wp post get {POST_ID} --field=post_date`
Then STDOUT should contain:
"""
2005-01-24 09:52:00
"""