Forum: RSpec how to write “Destroy kid” in cucumber

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
44e404d99992318e9fcf723312f0adfd?d=identicon&s=25 Atish k. (atish)
on 2013-09-27 09:37
how to write “Destroy kid” in cucumber

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>

 <th>Kid name</th>
 <th colspan=3>Action</th>
<% @kids.each do |kid| %>
    <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>

<% end %>

<%= link_to 'New Kid', new_kid_path %>

what to write for this step:

When /^I Destroy kid$/ do
    #what to write......
This topic is locked and can not be replied to.