diff --git a/app/controllers/officing/booth_controller.rb b/app/controllers/officing/booth_controller.rb index e3bde3b8d..624de8a2b 100644 --- a/app/controllers/officing/booth_controller.rb +++ b/app/controllers/officing/booth_controller.rb @@ -7,14 +7,14 @@ class Officing::BoothController < Officing::BaseController if only_one_booth? set_booth(@booths.first) - redirect_to officing_root_path, notice: t("officing.booth.new.success", booth: @booths.first.name) + redirect_to officing_root_path, notice: t("officing.booth.new.success", booth: @booths.first.location) end end def create find_booth set_booth(@booth) - redirect_to officing_root_path, notice: t("officing.booth.new.success", booth: @booth.name) + redirect_to officing_root_path, notice: t("officing.booth.new.success", booth: @booth.location) end private diff --git a/app/views/officing/booth/new.html.erb b/app/views/officing/booth/new.html.erb index 5fbcd429e..6cbfeda0f 100644 --- a/app/views/officing/booth/new.html.erb +++ b/app/views/officing/booth/new.html.erb @@ -11,7 +11,7 @@
<%= f.select :id, - @booths.collect { |booth| [booth.name, booth.id] }, + @booths.collect { |booth| [booth.location, booth.id] }, selected: @booths.first, label: false, tabindex: "1" %> diff --git a/spec/features/officing/booth_spec.rb b/spec/features/officing/booth_spec.rb index a4f9d3d0c..8f0e6cd3d 100644 --- a/spec/features/officing/booth_spec.rb +++ b/spec/features/officing/booth_spec.rb @@ -30,7 +30,7 @@ feature "Booth" do login_through_form_as(officer.user) - expect(page).to have_content "You are officing the booth located at #{booth.name}." + expect(page).to have_content "You are officing the booth located at #{booth.location}." end scenario "Officer with multiple booth assignments today" do @@ -51,10 +51,10 @@ feature "Booth" do expect(page).to have_content "You have been signed in successfully." expect(page).to have_content "Choose your booth" - select booth2.name, from: "booth_id" + select booth2.location, from: "booth_id" click_button "Enter" - expect(page).to have_content "You are officing the booth located at #{booth2.name}." + expect(page).to have_content "You are officing the booth located at #{booth2.location}." end scenario "Display single booth for any number of polls" do @@ -79,7 +79,7 @@ feature "Booth" do expect(page).to have_content "You have been signed in successfully." expect(page).to have_content "Choose your booth" - expect(page).to have_select("booth_id", options: [booth1.name, booth2.name]) + expect(page).to have_select("booth_id", options: [booth1.location, booth2.location]) end end