displays booth location instead of booth name

This commit is contained in:
rgarcia
2017-02-15 17:51:47 +01:00
committed by Javi Martín
parent 0286ca4c59
commit 9c59c8b68e
3 changed files with 7 additions and 7 deletions

View File

@@ -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

View File

@@ -11,7 +11,7 @@
<div class="row">
<div class="small-12 column">
<%= f.select :id,
@booths.collect { |booth| [booth.name, booth.id] },
@booths.collect { |booth| [booth.location, booth.id] },
selected: @booths.first,
label: false,
tabindex: "1" %>

View File

@@ -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