Add flash error for shift creation without date, increase spec

This commit is contained in:
Bertocq
2017-09-28 10:53:15 +02:00
parent 08cdf93ecc
commit 49b4af5e04
4 changed files with 6 additions and 4 deletions

View File

@@ -14,10 +14,10 @@ class Admin::Poll::ShiftsController < Admin::Poll::BaseController
@officer = @shift.officer
if @shift.save
notice = t("admin.poll_shifts.flash.create")
redirect_to new_admin_booth_shift_path(@shift.booth), notice: notice
redirect_to new_admin_booth_shift_path(@shift.booth), notice: t("admin.poll_shifts.flash.create")
else
load_shifts
flash[:error] = t("admin.poll_shifts.flash.date_missing")
render :new
end
end