有没有人对这个黄瓜情景的例子有一个建议:
When a "POST" on an endpoint of a webservice is issued with JSON:
"""
{
"from" : "<sip:+441111111111@1.1.1.1>;tag=abcd001",
"to" : "<tel:+44222222222@2.2.2.2>;tag=xyz0001"
}
"""
现在当我在step_definition中得到这个json时:
When(/^a "([^"]*)" on an endpoint of a webservice is issued with JSON:$/) do |arg1, string|
puts arg1, string
end
put的STDOUT显示正确的字符串,但是当我使用html格式时,它会将字符串放在尖括号下,即html格式化程序输出显示:
POST
{
"from" : ";tag=abcd001",
"to" : ";tag=xyz0001"
}
我试图逃避字符串,但这似乎也没有用,而且在进行REST调用时,它会增加额外的挑战。有什么见解吗?