0
我想編寫刪除測試場景,但我不明白爲什麼它沒有獲取銷燬鏈接。無法找到「銷燬」鏈接
這裏我的測試場景:
Scenario: User can delete kids
Given I am on the kids page
When I Destroy kid
Then I should see "Kid deleted successfully"
Then one kid should not exist
<h1>Listing kids</h1>
<tr>
<th>Kid name</th>
<th colspan=3>Action</th>
</tr>
<% @kids.each do |kid| %>
<tr>
<td><%= kid.kid_name %></td>
<td><%= link_to 'Show', kid %></td>
<td><%= link_to 'Edit', edit_kid_path(kid) %></td>
<td><%= link_to 'Destroy', kid, method: :delete,
data: { confirm: 'Are you sure?' } %></td>
</tr>
<%結束%>
<%=的link_to '新來的小子',new_kid_path%>
我的步驟,鏈接認定中:
When /^I Destroy kid$/ do |link|
click_link(link)
end
請有人建議刪除鏈接的步驟定義,如果他們在我的方案中有一些錯誤,請糾正我。
謝謝。
您可以發佈正在尋找鏈接步驟? –
您可以發佈./features/step_definitions/event_steps.rb:32:in內容:「/ ^我遵循」([^ \「] *)」$ /' – techvineet
@techvineet這是內容當/ ^我關注「([^ \」] *)「$/do | link | click_link(link) end – atish