mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Adds conference update errors to flash
- fix tests
This commit is contained in:
parent
e87e7e8fe6
commit
b94b5a4c75
2 changed files with 4 additions and 1 deletions
|
|
@ -32,8 +32,9 @@ class Admin::ConferenceController < ApplicationController
|
|||
redirect_to(admin_conference_path(id: @conference.short_title),
|
||||
notice: 'Conference was successfully updated.')
|
||||
else
|
||||
errors = @conference.errors.full_messages.join('! ')
|
||||
redirect_to(admin_conference_path(id: short_title),
|
||||
notice: 'Conference update failed.')
|
||||
flash: { error: "Conference update failed. #{errors}" })
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ describe Admin::ConferenceController do
|
|||
short_title: nil)
|
||||
|
||||
conference.reload
|
||||
expect(flash[:error]).to eq("Conference update failed. Short title can't be blank")
|
||||
expect(conference.title).to eq('The dog and pony show')
|
||||
expect(conference.short_title).to eq('dps14')
|
||||
end
|
||||
|
|
@ -52,6 +53,7 @@ describe Admin::ConferenceController do
|
|||
attributes_for(:conference, title: 'Example Con',
|
||||
short_title: nil)
|
||||
|
||||
expect(flash[:error]).to eq("Conference update failed. Short title can't be blank")
|
||||
expect(response).to redirect_to admin_conference_path(
|
||||
conference.short_title)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue