diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index 0545e6af5..008f36f3e 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -489,15 +489,11 @@ en: no_officers: "There are no officers assigned to this poll." table_name: "Name" table_email: "Email" - add_officer_assignments: "Add shifts as officer" - edit_officer_assignments: "Edit officing shifts" by_officer: date: "Date" booth: "Booth" assignments: "Officing shifts in this poll" no_assignments: "This user has no officing shifts in this poll." - total_recounts: "Total recounts" - total_recount: "Total recount (by officer)" poll_shifts: new: add_shift: "Add shift" @@ -570,7 +566,6 @@ en: results_tab: Results no_questions: "There are no questions assigned to this poll." questions_title: "List of questions" - remove_question: "Remove question from poll" add_question: "Include question" table_title: "Title" table_assignment: "Assignment" @@ -578,8 +573,6 @@ en: flash: question_added: "Question added to this poll" error_on_question_added: "Question could not be assigned to this poll" - question_removed: "Question removed from this poll" - error_on_question_removed: "Question could not be removed from this poll" questions: index: title: "Questions" @@ -606,7 +599,6 @@ en: description: Description video_url: External video documents: Documents (1) - preview: View on website recounts: index: title: "Recounts" diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index 816cadd57..4a4616338 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -489,15 +489,11 @@ es: no_officers: "No hay presidentes de mesa asignados a esta votación." table_name: "Nombre" table_email: "Email" - add_officer_assignments: "Añadir turnos como presidente de mesa" - edit_officer_assignments: "Editar turnos" by_officer: date: "Fecha" booth: "Urna" assignments: "Turnos como presidente de mesa en esta votación" no_assignments: "No tiene turnos como presidente de mesa en esta votación." - total_recounts: "Recuentos totales" - total_recount: "Recuento total (presidente de mesa)" poll_shifts: new: add_shift: "Añadir turno" @@ -570,7 +566,6 @@ es: results_tab: Resultados no_questions: "No hay preguntas asignadas a esta votación." questions_title: "Listado de preguntas asignadas" - remove_question: "Desasignar pregunta" add_question: "Incluir pregunta" table_title: "Título" table_assignment: "Asignación" @@ -578,8 +573,6 @@ es: flash: question_added: "Pregunta añadida a esta votación" error_on_question_added: "No se pudo asignar la pregunta" - question_removed: "Pregunta eliminada de esta votación" - error_on_question_removed: "No se pudo quitar la pregunta" questions: index: title: "Preguntas ciudadanas" @@ -606,7 +599,6 @@ es: description: Descripción video_url: Video externo documents: Documentos (1) - preview: Ver en la web recounts: index: title: "Recuentos" diff --git a/spec/features/admin/poll/polls_spec.rb b/spec/features/admin/poll/polls_spec.rb index 6eb64f6e1..153f0885a 100644 --- a/spec/features/admin/poll/polls_spec.rb +++ b/spec/features/admin/poll/polls_spec.rb @@ -181,54 +181,6 @@ feature 'Admin polls' do expect(page).to_not have_content "There are no questions assigned to this poll" end - scenario 'Add question to poll', :js do - poll = create(:poll) - question = create(:poll_question, title: 'Should we rebuild the city?') - - visit admin_poll_path(poll) - - expect(page).to have_content 'Questions (0)' - expect(page).to have_content 'There are no questions assigned to this poll' - - fill_in 'search-questions', with: 'rebuild' - click_button 'Search' - - within('#search-questions-results') do - click_link 'Include question' - end - - expect(page).to have_content 'Question added to this poll' - - visit admin_poll_path(poll) - - expect(page).to have_content 'Questions (1)' - expect(page).to_not have_content 'There are no questions assigned to this poll' - expect(page).to have_content question.title - end - - scenario 'Remove question from poll', :js do - poll = create(:poll) - question = create(:poll_question, poll: poll) - - visit admin_poll_path(poll) - - expect(page).to have_content 'Questions (1)' - expect(page).to_not have_content 'There are no questions assigned to this poll' - expect(page).to have_content question.title - - within("#poll_question_#{question.id}") do - click_link 'Remove question from poll' - end - - expect(page).to have_content 'Question removed from this poll' - - visit admin_poll_path(poll) - - expect(page).to have_content 'Questions (0)' - expect(page).to have_content 'There are no questions assigned to this poll' - expect(page).to_not have_content question.title - end - end end diff --git a/spec/features/admin/poll/shifts_spec.rb b/spec/features/admin/poll/shifts_spec.rb index 46c737c64..9dea5f8d1 100644 --- a/spec/features/admin/poll/shifts_spec.rb +++ b/spec/features/admin/poll/shifts_spec.rb @@ -31,13 +31,14 @@ feature 'Admin shifts' do end scenario "Create Vote Collection Shift", :js do - poll = create(:poll) + poll = create(:poll, :current) vote_collection_dates = (poll.starts_at.to_date..poll.ends_at.to_date).to_a.map { |date| I18n.l(date, format: :long) } booth = create(:poll_booth) + assignment = create(:poll_booth_assignment, poll: poll, booth: booth) officer = create(:poll_officer) - visit admin_booths_path + visit available_admin_booths_path within("#booth_#{booth.id}") do click_link "Manage shifts" @@ -63,13 +64,14 @@ feature 'Admin shifts' do end scenario "Create Recount & Scrutiny Shift", :js do - poll = create(:poll) + poll = create(:poll, :current) recount_scrutiny_dates = (poll.ends_at.to_date..poll.ends_at.to_date + 1.week).to_a.map { |date| I18n.l(date, format: :long) } booth = create(:poll_booth) + assignment = create(:poll_booth_assignment, poll: poll, booth: booth) officer = create(:poll_officer) - visit admin_booths_path + visit available_admin_booths_path within("#booth_#{booth.id}") do click_link "Manage shifts" @@ -97,11 +99,12 @@ feature 'Admin shifts' do end scenario "Error on create", :js do - poll = create(:poll) + poll = create(:poll, :current) booth = create(:poll_booth) + assignment = create(:poll_booth_assignment, poll: poll, booth: booth) officer = create(:poll_officer) - visit admin_booths_path + visit available_admin_booths_path within("#booth_#{booth.id}") do click_link "Manage shifts"