Skip to content

Instantly share code, notes, and snippets.

@roykolak
Created March 1, 2011 15:18
Show Gist options
  • Save roykolak/849276 to your computer and use it in GitHub Desktop.
Save roykolak/849276 to your computer and use it in GitHub Desktop.
# BAD
scenario "When I click on an appointment, I am taken to that appointment's details" do
visit my_appointments_path
find('li.appointment:first-child .block_link').click
current_path.should == my_appointment_path(fittings.last)
page.should have_css('li.appointment .selected')
end
#GOOD
scenario "Viewing a specific appointment" do
# When I visit the appointments page
visit my_appointments_path
# And I click an appointment
find('li.appointment:first-child .block_link').click
# Then I should be taken to the appointment's detail page
current_path.should == my_appointment_path(fittings.last)
# And the appointment date should be selected
page.should have_css('li.appointment .selected')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment