Closed christeredvartsen closed 7 years ago
An implementation of this assertion can be found here: https://github.com/imbo/imbo/pull/513/commits/f2b0716f076e3e87b34f814f8d2d1017e346c7db
It might be better to split this into two different steps to have better error handling (for instance if one specifies a file that does not exist). The two steps could be:
Given the request body contains :path
Given the request body is :string
Currently there is no way to set the request body without making the request in the same step. The following step might do the trick:
@Given the request body contains :content( as a string)
where
:content
can be a string. The step should check if:content
is a path (unless theas a string
part is specified in the step), and if so, attach a resource to the request body instead of the actual string, along with setting the correctContent-Type
request header.When
as a string
is used, the:content
will be treated as a string even if it might be a valid path.