Created
April 13, 2012 23:23
-
-
Save radar/2380835 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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