How to write “Destroy kid” in cucumber

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

Listing kids

Kid name Action <% @kids.each do |kid| %> <%= kid.kid_name %> <%= link_to 'Show', kid %> <%= link_to 'Edit', edit_kid_path(kid) %> <%= link_to 'Destroy', kid, method: :delete, data: { confirm: 'Are you sure?' } %>

<% end %>

<%= link_to ‘New Kid’, new_kid_path %>

what to write in definition:

When /^I Destroy kid$/ do
#what to write…

Please suggest me.
Thank you

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs