adds link to results for each final recount in officing
This commit is contained in:
@@ -53,6 +53,7 @@
|
|||||||
<th><%= t("officing.final_recounts.new.booth") %></th>
|
<th><%= t("officing.final_recounts.new.booth") %></th>
|
||||||
<th><%= t("officing.final_recounts.new.count") %></th>
|
<th><%= t("officing.final_recounts.new.count") %></th>
|
||||||
<th><%= t("officing.final_recounts.new.system_count") %></th>
|
<th><%= t("officing.final_recounts.new.system_count") %></th>
|
||||||
|
<th> </th>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<% @final_recounts.each do |final_recount| %>
|
<% @final_recounts.each do |final_recount| %>
|
||||||
@@ -69,6 +70,9 @@
|
|||||||
<td>
|
<td>
|
||||||
<strong><%= system_recount_to_compare_with_final_recount final_recount %></strong>
|
<strong><%= system_recount_to_compare_with_final_recount final_recount %></strong>
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
<%= link_to t("officing.final_recounts.new.add_results"), new_officing_poll_result_path(@poll, oa: final_recount.officer_assignment.id, d: l(final_recount.date.to_date) )%>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ en:
|
|||||||
submit: Save
|
submit: Save
|
||||||
final_recount_list: "Your final recounts"
|
final_recount_list: "Your final recounts"
|
||||||
system_count: "System recount"
|
system_count: "System recount"
|
||||||
|
add_results: "Add results"
|
||||||
results:
|
results:
|
||||||
flash:
|
flash:
|
||||||
create: "Results saved"
|
create: "Results saved"
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ es:
|
|||||||
submit: "Guardar"
|
submit: "Guardar"
|
||||||
final_recount_list: "Tus recuentos finales"
|
final_recount_list: "Tus recuentos finales"
|
||||||
system_count: "Recuento del sistema"
|
system_count: "Recuento del sistema"
|
||||||
|
add_results: "Añadir resultados"
|
||||||
results:
|
results:
|
||||||
flash:
|
flash:
|
||||||
create: "Datos guardados"
|
create: "Datos guardados"
|
||||||
|
|||||||
@@ -122,6 +122,26 @@ feature 'Officing Final Recount' do
|
|||||||
expect(page).to have_content('100')
|
expect(page).to have_content('100')
|
||||||
expect(page).to have_content('33')
|
expect(page).to have_content('33')
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scenario "Show link to add results for same booth/date" do
|
||||||
|
final_officer_assignment = create(:poll_officer_assignment, :final, officer: @poll_officer)
|
||||||
|
poll = final_officer_assignment.booth_assignment.poll
|
||||||
|
poll.update(ends_at: 1.day.ago)
|
||||||
|
final_recount = create(:poll_final_recount,
|
||||||
|
officer_assignment: final_officer_assignment,
|
||||||
|
booth_assignment: final_officer_assignment.booth_assignment,
|
||||||
|
date: 7.days.ago,
|
||||||
|
count: 100)
|
||||||
|
visit new_officing_poll_final_recount_path(poll)
|
||||||
|
within("#poll_final_recount_#{final_recount.id}") do
|
||||||
|
click_link "Add results"
|
||||||
|
end
|
||||||
|
|
||||||
|
expected_path = new_officing_poll_result_path(poll, oa: final_recount.officer_assignment.id, d: I18n.l(final_recount.date.to_date))
|
||||||
|
expect(page).to have_current_path(expected_path)
|
||||||
|
expect(page).to have_select('officer_assignment_id', selected: final_recount.booth_assignment.booth.name)
|
||||||
|
expect(page).to have_select('date', selected: I18n.l(final_recount.date.to_date, format: :long))
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
Reference in New Issue
Block a user