# How to write “Destroy kid” in cucumber

**URL:** <https://www.ruby-forum.com/t/how-to-write-destroy-kid-in-cucumber/236711>\
**Category:** RSpec\
**Created:** [September 27, 2013, 9:37am UTC](https://www.ruby-forum.com/t/how-to-write-destroy-kid-in-cucumber/236711 "2013-09-27T09:37:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alcina](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a587f6/32.png) [@alcina](https://www.ruby-forum.com/u/alcina)\
**Post date:** [September 27, 2013, 9:37am UTC](https://www.ruby-forum.com/t/how-to-write-destroy-kid-in-cucumber/236711/1 "2013-09-27T09:37:25Z")

</div>

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 for this step:

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