Skip to content

Commit

Permalink
Move url-to-id tests to a separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbachhuber committed Nov 19, 2023
1 parent 764bd8f commit a4fb7ea
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
25 changes: 25 additions & 0 deletions features/post-url-to-id.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Feature: Get the post ID for a given URL

Background:
Given a WP install

@daniel
Scenario: Get the post ID for a given URL
When I run `wp post get 1 --field=url`
Then STDOUT should be:
"""
https://example.com/?p=1
"""
And save STDOUT as {POST_URL}

When I run `wp post url-to-id {POST_URL}`
Then STDOUT should contain:
"""
1
"""

When I try `wp post url-to-id 'https://example.com/?p=404'`
Then STDERR should contain:
"""
Could not get post with url https://example.com/?p=404.
"""
13 changes: 0 additions & 13 deletions features/post.feature
Original file line number Diff line number Diff line change
Expand Up @@ -259,19 +259,6 @@ Feature: Manage WordPress posts
"""
https://example.com/?p=1
"""
And save STDOUT as {POST_URL}

When I run `wp post url-to-id {POST_URL}`
Then STDOUT should contain:
"""
1
"""

When I try `wp post url-to-id 'https://example.com/?p=404'`
Then STDERR should contain:
"""
Could not get post with url https://example.com/?p=404.
"""

Scenario: Update a post from file or STDIN
Given a content.html file:
Expand Down

0 comments on commit a4fb7ea

Please sign in to comment.