Remove system count from old booth assigments
This number was not the important one; the important one is the one given by the recounts. Note we're also removing the votes by date, since they're also system votes.
This commit is contained in:
@@ -58,7 +58,10 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="text-center"><%= t("admin.poll_booth_assignments.show.count_final") %></th>
|
<th class="text-center"><%= t("admin.poll_booth_assignments.show.count_final") %></th>
|
||||||
|
|
||||||
|
<% unless @poll.recounts_confirmed? %>
|
||||||
<th class="text-center"><%= t("admin.poll_booth_assignments.show.total_system") %></th>
|
<th class="text-center"><%= t("admin.poll_booth_assignments.show.total_system") %></th>
|
||||||
|
<% end %>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -66,13 +69,17 @@
|
|||||||
<td class="text-center" id="total_final">
|
<td class="text-center" id="total_final">
|
||||||
<%= total_recounts_by_booth(@booth_assignment) || "-" %>
|
<%= total_recounts_by_booth(@booth_assignment) || "-" %>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
<% unless @poll.recounts_confirmed? %>
|
||||||
<td class="text-center" id="total_system">
|
<td class="text-center" id="total_system">
|
||||||
<%= @booth_assignment.voters.count %>
|
<%= @booth_assignment.voters.count %>
|
||||||
</td>
|
</td>
|
||||||
|
<% end %>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
<% unless @poll.recounts_confirmed? %>
|
||||||
<table id="recounts_list">
|
<table id="recounts_list">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -90,6 +97,7 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="tabs-panel is-active" id="tab-results">
|
<div class="tabs-panel is-active" id="tab-results">
|
||||||
<%= render "results" %>
|
<%= render "results" %>
|
||||||
|
|||||||
@@ -204,6 +204,26 @@ describe "Admin booths assignments" do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scenario "Doesn't show system recounts for old polls" do
|
||||||
|
poll = create(:poll, :old)
|
||||||
|
booth_assignment = create(:poll_booth_assignment, poll: poll)
|
||||||
|
|
||||||
|
create(:poll_voter, poll: poll, booth_assignment: booth_assignment)
|
||||||
|
create(:poll_recount, booth_assignment: booth_assignment, total_amount: 10)
|
||||||
|
|
||||||
|
visit admin_poll_booth_assignment_path(poll, booth_assignment)
|
||||||
|
|
||||||
|
within("#totals") do
|
||||||
|
within("#total_final") do
|
||||||
|
expect(page).to have_content "10"
|
||||||
|
end
|
||||||
|
|
||||||
|
expect(page).not_to have_selector "#total_system"
|
||||||
|
end
|
||||||
|
|
||||||
|
expect(page).not_to have_selector "#recounts_list"
|
||||||
|
end
|
||||||
|
|
||||||
scenario "Results for a booth assignment" do
|
scenario "Results for a booth assignment" do
|
||||||
poll = create(:poll)
|
poll = create(:poll)
|
||||||
booth_assignment = create(:poll_booth_assignment, poll: poll)
|
booth_assignment = create(:poll_booth_assignment, poll: poll)
|
||||||
|
|||||||
Reference in New Issue
Block a user