我正在为我的 RoR 应用程序编写一些 Cucumber 功能,这些功能将记录插入数据库,然后向我的 XML API 发送查询。由于我的请求(硬编码 XML)的性质,我需要知道一行的 ID 是什么。这是我的场景:
Scenario: Client requests call info
Given There is a call like:
| id | caller_phone_number |
| 1 | 3103937123 |
When I head over to call info
And Post this XML:
"""
<?xml version="1.0" encoding="UTF-8"?>
<request-call-info>
<project-code>1000000001</project-code>
</request-call-info>
"""
Then The call info should match
And The status code should be 0
我已经用我的 _test 数据库设置了 Cuke,而且我还注意到它并没有在运行我的功能之前重置所有表。
设置它的正确方法是什么?谢谢!