displays booth location instead of booth name
This commit is contained in:
@@ -7,14 +7,14 @@ class Officing::BoothController < Officing::BaseController
|
|||||||
|
|
||||||
if only_one_booth?
|
if only_one_booth?
|
||||||
set_booth(@booths.first)
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
find_booth
|
find_booth
|
||||||
set_booth(@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
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="small-12 column">
|
<div class="small-12 column">
|
||||||
<%= f.select :id,
|
<%= f.select :id,
|
||||||
@booths.collect { |booth| [booth.name, booth.id] },
|
@booths.collect { |booth| [booth.location, booth.id] },
|
||||||
selected: @booths.first,
|
selected: @booths.first,
|
||||||
label: false,
|
label: false,
|
||||||
tabindex: "1" %>
|
tabindex: "1" %>
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ feature "Booth" do
|
|||||||
|
|
||||||
login_through_form_as(officer.user)
|
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
|
end
|
||||||
|
|
||||||
scenario "Officer with multiple booth assignments today" do
|
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 "You have been signed in successfully."
|
||||||
expect(page).to have_content "Choose your booth"
|
expect(page).to have_content "Choose your booth"
|
||||||
|
|
||||||
select booth2.name, from: "booth_id"
|
select booth2.location, from: "booth_id"
|
||||||
click_button "Enter"
|
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
|
end
|
||||||
|
|
||||||
scenario "Display single booth for any number of polls" do
|
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 "You have been signed in successfully."
|
||||||
expect(page).to have_content "Choose your booth"
|
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
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user