contexts
contexts copied to clipboard
Bug on RestContext
On the RestContext, we need to add quotes on the following to steps around the method name:
- @Given /^I send a (?P
[A-Z]+) request on "(?P [^"]*)"$/ - @Given /^I send a (?P
[A-Z]+) request on "(?P [^"]*)" with parameters:$/
If we do not do it, behat does not catch it is a parameter. Correct me if I am wrong.
It would be nice to have a step to assert the reason phrase, like we have for status code. When I get 200 response, I would like also to check the reason phrase is "OK".
On the RestContext, we need to add quotes on the following to steps around the method name
No, behat catches parameters with parenthesis.
It would be nice to have a step to assert the reason phrase, like we have for status code. When I get 200 response, I would like also to check the reason phrase is "OK".
You can use Then the header "Reason-Phrase" should be equal to "OK".
You are absolutely right about the parenthesis. It works fine.
About the reason phrase, I should be doing something wrong. I get the message there is no reason-phrase header. If I print last response headers, it is not there. IMHO it should not be a header, reason phrase is part of the first line of the response, like the status code, not really a header. I get the following headers:
| date: Wed, 18 Sep 2013 14:33:25 GMT | server: Apache | x-powered-by: PHP/5.3.10-1ubuntu3.8 | set-cookie: PHPSESSID=cpio70b687k9bjisgvq46c9tt2; path=/ | cache-control: no-cache | x-debug-token: 38c19a | vary: Accept-Encoding | transfer-encoding: chunked | content-type: application/json
Ok, the reason phrase is a part of the status header: Status Code and Reason Phrase.
It should be great to have a definition for test it.
Waiting for MinkExtension #113.
The blocker, https://github.com/Behat/MinkExtension/issues/113, has been closed one year ago.
ping