diff --git a/config/locales/admin.en.yml b/config/locales/admin.en.yml
index 310a9142e..3d68b02bb 100755
--- a/config/locales/admin.en.yml
+++ b/config/locales/admin.en.yml
@@ -180,6 +180,18 @@ en:
remove_assignment: "Remove"
assignments: "Officing shifts in this poll"
no_assignments: "This user has no officing shifts in this poll."
+ poll_booth_assignments:
+ show:
+ location: "Location"
+ officers: "Officers"
+ officers_list: "Officer list for this booth"
+ no_officers: "There are no officers for this booth"
+ recounts: "Recounts"
+ recounts_list: "Recount list for this booth"
+ no_recounts: "There are not daily recounts of this booth yet"
+ date: "Date"
+ count_by_officer: "Votes (by officer)"
+ count_by_system: "Votes (automatic)"
polls:
index:
title: "List of polls"
diff --git a/config/locales/admin.es.yml b/config/locales/admin.es.yml
index a461d165e..7c93b87da 100644
--- a/config/locales/admin.es.yml
+++ b/config/locales/admin.es.yml
@@ -180,6 +180,18 @@ es:
remove_assignment: "Eliminar turno"
assignments: "Turnos como presidente de mesa en esta votación"
no_assignments: "No tiene turnos como presidente de mesa en esta votación."
+ poll_booth_assignments:
+ show:
+ location: "Ubicación"
+ officers: "Presidentes de mesa"
+ officers_list: "Lista de presidentes de mesa asignados a esta urna"
+ no_officers: "No hay presidentes de mesa para esta urna"
+ recounts: "Recuentos"
+ recounts_list: "Lista de recuentos de esta urna"
+ no_recounts: "No hay recuentos diarios de esta urna"
+ date: "Fecha"
+ count_by_officer: "Votos (presidente de mesa)"
+ count_by_system: "Votos (automático)"
polls:
index:
title: "Listado de votaciones"
diff --git a/config/routes.rb b/config/routes.rb
index ef064513e..52d413730 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -186,15 +186,18 @@ Rails.application.routes.draw do
end
scope module: :poll do
- resources :officers do
- get :search, on: :collection
- end
resources :polls do
get :search_booths, on: :member
get :search_officers, on: :member
get :search_questions, on: :member
patch :add_question, on: :member
patch :remove_question, on: :member
+
+ resources :booth_assignments, only: :show
+ end
+
+ resources :officers do
+ get :search, on: :collection
end
resources :booths
diff --git a/spec/features/admin/poll/booth_assigments_spec.rb b/spec/features/admin/poll/booth_assigments_spec.rb
index 3f21e0089..c7db2b593 100644
--- a/spec/features/admin/poll/booth_assigments_spec.rb
+++ b/spec/features/admin/poll/booth_assigments_spec.rb
@@ -39,7 +39,7 @@ feature 'Admin booths assignments' do
scenario 'remove booth from poll', :js do
poll = create(:poll)
booth = create(:poll_booth)
- create(:poll_booth_assignment, poll: poll, booth: booth)
+ assignment = create(:poll_booth_assignment, poll: poll, booth: booth)
visit admin_poll_path(poll)
within('#poll-resources') do
@@ -49,7 +49,7 @@ feature 'Admin booths assignments' do
expect(page).to_not have_content 'There are no booths assigned to this poll.'
expect(page).to have_content booth.name
- within("#booth_#{booth.id}") do
+ within("#poll_booth_assignment_#{assignment.id}") do
click_link 'Remove booth from poll'
end
diff --git a/spec/features/admin/poll/polls_spec.rb b/spec/features/admin/poll/polls_spec.rb
index 6f4f60a3d..95bf9bc9a 100644
--- a/spec/features/admin/poll/polls_spec.rb
+++ b/spec/features/admin/poll/polls_spec.rb
@@ -98,7 +98,7 @@ feature 'Admin polls' do
context "Poll show" do
- scenario "No booths", :js do
+ scenario "No booths" do
poll = create(:poll)
visit admin_poll_path(poll)
click_link "Booths (0)"
@@ -106,7 +106,7 @@ feature 'Admin polls' do
expect(page).to have_content "There are no booths assigned to this poll."
end
- scenario "Booth list", :js do
+ scenario "Booth list" do
poll = create(:poll)
3.times { create(:poll_booth, polls: [poll]) }
@@ -115,11 +115,10 @@ feature 'Admin polls' do
expect(page).to have_css ".booth", count: 3
- booths = Poll::Booth.all
- booths.each do |booth|
- within("#booth_#{booth.id}") do
- expect(page).to have_content booth.name
- expect(page).to have_content booth.location
+ poll.booth_assignments.each do |ba|
+ within("#poll_booth_assignment_#{ba.id}") do
+ expect(page).to have_content ba.booth.name
+ expect(page).to have_content ba.booth.location
end
end
expect(page).to_not have_content "There are no booths assigned to this poll."