mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-07 04:42:28 -04:00
Merge pull request #801 from sonalkr132/targets_test
Model and controller tests for Target
This commit is contained in:
commit
782a1f071f
4 files changed
+279
-54
No files matched your search
@@ -3,9 +3,7 @@ module Admin
|
||||
load_and_authorize_resource :conference, find_by: :short_title
|
||||
load_and_authorize_resource :target, through: :conference
|
||||
|
||||
def index
|
||||
authorize! :update, Target.new(conference_id: @conference.id)
|
||||
end
|
||||
def index; end
|
||||
|
||||
def new
|
||||
@target = @conference.targets.new
|
||||
@@ -39,9 +37,9 @@ module Admin
|
||||
redirect_to(admin_conference_targets_path(conference_id: @conference.short_title),
|
||||
notice: 'Target successfully destroyed.')
|
||||
else
|
||||
redirect_to(admin_conference_targets_path(conference_id: @conference.short_title),
|
||||
error: 'Target was successfully destroyed.' \
|
||||
"#{@target.errors.full_messages.join('. ')}.")
|
||||
redirect_to admin_conference_targets_path(conference_id: @conference.short_title),
|
||||
flash: { error: "Could not delete target for #{@conference.title}: "\
|
||||
"#{@target.errors.full_messages.join('. ')}." }
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user