mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-14 04:04:03 +00:00
commit
c9b65e9a5d
2 changed files with 8 additions and 5 deletions
|
|
@ -21,7 +21,8 @@ class Admin::ConferenceController < ApplicationController
|
|||
notice: 'Conference was successfully created.')
|
||||
else
|
||||
redirect_to(new_admin_conference_path,
|
||||
flash: { error: @conference.errors.full_messages.join('! ') })
|
||||
alert: 'Creating the Conference failed.' \
|
||||
"#{@conference.errors.full_messages.join('. ')}.")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -32,9 +33,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),
|
||||
flash: { error: "Conference update failed. #{errors}" })
|
||||
alert: 'Updating conference failed. ' \
|
||||
"#{@conference.errors.full_messages.join('. ')}.")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,8 @@ describe Admin::ConferenceController do
|
|||
short_title: nil)
|
||||
|
||||
conference.reload
|
||||
expect(flash[:error]).to eq("Conference update failed. Short title can't be blank")
|
||||
expect(flash[:alert]).
|
||||
to eq("Updating conference 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
|
||||
|
|
@ -58,7 +59,8 @@ 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(flash[:alert]).
|
||||
to eq("Updating conference 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