Skip to content

Instantly share code, notes, and snippets.

@ivanoats
Created October 11, 2013 00:06
Show Gist options
  • Save ivanoats/6927641 to your computer and use it in GitHub Desktop.
Save ivanoats/6927641 to your computer and use it in GitHub Desktop.
better way to delete scaffold post
require "test_helper"
feature "PostDelete" do
scenario "can delete a post" do
@only = posts(:post_brand_new).id
#Given I have a existing post
visit posts_path
#When I click the delete link
puts "/posts/#{@only}"
click_link('Destroy', href: "/posts/#{@only}")
#Then post is destroyed and no longer seen
page.wont_have_content posts(:post_brand_new).title
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment