Given /^the following <%= plural_name %>:$/ do |<%= plural_name %>|
  <%= class_name %>.create!(<%= plural_name %>.hashes)
end

When /^I delete the (\d+)(?:st|nd|rd|th) <%= singular_name %>$/ do |pos|
  visit <%= plural_name %>_url
  within("table > tr:nth-child(#{pos.to_i+1})") do
    click_link "Destroy"
  end
end

Then /^I should see the following <%= plural_name %>:$/ do |expected_<%= plural_name %>_table|
  expected_<%= plural_name %>_table.diff!(table_at('table').to_a)
end
