Created
June 20, 2011 01:33
-
-
Save rafarubert/1034998 to your computer and use it in GitHub Desktop.
teste capybara
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
#encoding: utf-8 | |
require 'acceptance/acceptance_helper' | |
include HelperMethods | |
feature "Marcando Consulta", %Q{ | |
como um atendente | |
} do | |
before(:each) do | |
Factory(:atendente_user) | |
Factory(:convenio) | |
Factory(:horario_atendimento, {dia_semana: Date.today.wday}) | |
end | |
scenario "Quando visitar a url de horarios disponiveis do dia e clicar em um dia devo ver um formulário com todos os campos para marcar consulta", :js => true do | |
login | |
visit atendente_agenda_diaria_path(I18n.l(Date.today,:format => :url)) | |
page.should have_content("09:00") | |
click_link "09:00" | |
page.should have_content("#{Date.today.strftime("%d/%m")} às 09h00m") | |
page.should have_selector "#consulta_data_dia" | |
page.should have_selector "#consulta_data_hora" | |
page.should have_selector "#consulta_convenio_id" | |
page.should have_selector "#consulta_paciente_attributes_nome" | |
page.should have_selector "#consulta_paciente_attributes_telefone" | |
end | |
scenario "Quando um horario no formulario for alterado o titulo do popup deve ser atualizado" , :js => true do | |
visit "/" | |
login | |
visit atendente_agenda_diaria_path(I18n.l(Date.today,:format => :url)) | |
page.should have_content("09:00") | |
sleep 60 | |
click_link "09:00" | |
page.should have_content("#{Date.today.strftime("%d/%m")} às 09h00m") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment