From: scribu Date: Sun, 17 Feb 2013 03:11:02 +0000 (+0200) Subject: add tests for creating/updating/deleting a post X-Git-Tag: v0.9.0~86^2~5 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=5e555d3185d3b34b2053e3955ce2a189e39289a3;p=wvm%2Fwvm.git add tests for creating/updating/deleting a post --- diff --git a/features/post.feature b/features/post.feature new file mode 100644 index 00000000..2ecfe9b8 --- /dev/null +++ b/features/post.feature @@ -0,0 +1,29 @@ +Feature: Manage WordPress posts + + Scenario: Creating/updating/deleting posts + Given WP install + + When I run `wp post create --post_title='Test post' --porcelain` + Then it should run without errors + And STDOUT should match '%d' + And save STDOUT as {POST_ID} + + When I run `wp post update {POST_ID} --post_title='Updated post'` + Then it should run without errors + And STDOUT should be: + """ + Success: Updated post {POST_ID}. + """ + + When I run `wp post delete {POST_ID}` + Then it should run without errors + And STDOUT should be: + """ + Success: Trashed post {POST_ID}. + """ + + When I run the previous command again + Then it should run without errors + + When I run the previous command again + Then the return code should be 1