Then the REST route "/wp/v2/posts" should respond with status 200

Assert a REST route answers with a status code. The route is the part after /wp-json, with its query string, and the request is made as the logged-in user, or as a visitor.

Examples

Then the REST route "/wp/v2/posts" should respond with status 200
And the REST route "/wp/v2/pages?per_page=1" should respond with status 200
Then the REST route "/wp/v2/posts/999999999" should respond with status 404
And the REST route "/wp/v2/users/me" should respond with status 401
Then the REST route "/wp/v2/settings" should respond with status 401

Pattern

Then(/^the REST route "([^"]*)" should respond with status (\d+)$/, …)

Part of @webship-js/wordpress-steps (github.com/webship/wordpress-steps), a step pack for Webship-js 2.0.x.