setup :fixtures => :all
login :as => 'admin'
open "/projects"
click "css=#project_2 .buttons img.edit_item"
wait_for_visible "edit_project_2"
wait_for_not_visible "project_2"
type "//div[@id='edit_project_2'] //input[@name='project[name]']", "become a billionaire"
click "//div[@id='edit_project_2'] //button"
wait_for_not_visible "edit_project_2"
wait_for_visible "project_2"
wait_for_visible "flash"
wait_for_not_visible "flash"
click "css=#project_2 .buttons img.delete_item"
assert_confirmation "Are you sure that you want to delete the project 'become a billionaire'?"
wait_for_visible "flash"
assert_text "flash", "Deleted project 'become a billionaire'"
wait_for_element_not_present "project_2"