Skip to content

Commit a4fb7ea

Browse files
Move url-to-id tests to a separate file
1 parent 764bd8f commit a4fb7ea

File tree

2 files changed

+25
-13
lines changed

2 files changed

+25
-13
lines changed

features/post-url-to-id.feature

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Feature: Get the post ID for a given URL
2+
3+
Background:
4+
Given a WP install
5+
6+
@daniel
7+
Scenario: Get the post ID for a given URL
8+
When I run `wp post get 1 --field=url`
9+
Then STDOUT should be:
10+
"""
11+
https://example.com/?p=1
12+
"""
13+
And save STDOUT as {POST_URL}
14+
15+
When I run `wp post url-to-id {POST_URL}`
16+
Then STDOUT should contain:
17+
"""
18+
1
19+
"""
20+
21+
When I try `wp post url-to-id 'https://example.com/?p=404'`
22+
Then STDERR should contain:
23+
"""
24+
Could not get post with url https://example.com/?p=404.
25+
"""

features/post.feature

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -259,19 +259,6 @@ Feature: Manage WordPress posts
259259
"""
260260
https://example.com/?p=1
261261
"""
262-
And save STDOUT as {POST_URL}
263-
264-
When I run `wp post url-to-id {POST_URL}`
265-
Then STDOUT should contain:
266-
"""
267-
1
268-
"""
269-
270-
When I try `wp post url-to-id 'https://example.com/?p=404'`
271-
Then STDERR should contain:
272-
"""
273-
Could not get post with url https://example.com/?p=404.
274-
"""
275262

276263
Scenario: Update a post from file or STDIN
277264
Given a content.html file:

0 commit comments

Comments
 (0)