Skip to content

Instantly share code, notes, and snippets.

@psahni
Forked from radar/capybara.rb
Created May 22, 2012 04:56
Show Gist options
  • Save psahni/2766707 to your computer and use it in GitHub Desktop.
Save psahni/2766707 to your computer and use it in GitHub Desktop.
require 'spec_helper'
feature "Editing tickets" do
let!(:project) { Factory(:project) }
let!(:ticket) { Factory(:ticket, :project => project) }
before do
visit '/'
click_link project.name
click_link ticket.title
click_link "Edit Ticket"
end
scenario "Updating a ticket" do
fill_in "Title", :with => "Make it really shiny!"
click_button "Update Ticket"
page.should have_content "Ticket has been updated."
within("#ticket h2") do
page.should have_content("Make it really shiny!")
end
page.should_not have_content ticket.title
end
scenario "Updating a ticket with invalid information" do
fill_in "Title", :with => ""
click_button "Update Ticket"
page.should have_content("Ticket has not been updated.")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment