ensure an assignment group exists when editing assignment
this manifested itself in a bunch of tickets from pcsd Change-Id: I86a23cde6e1e55a8251124677bb0e66a2bd0cd92 Reviewed-on: https://gerrit.instructure.com/5170 Reviewed-by: Cody Cutrer <cody@instructure.com> Tested-by: Hudson <hudson@instructure.com>
This commit is contained in:
parent
1b2e96d5ef
commit
41bff4537a
|
@ -60,6 +60,7 @@ class AssignmentsController < ApplicationController
|
|||
return
|
||||
end
|
||||
if authorized_action(@assignment, @current_user, :read)
|
||||
@context.require_assignment_group
|
||||
@assignment_groups = @context.assignment_groups.active
|
||||
if !@assignment.new_record? && !@assignment_groups.map(&:id).include?(@assignment.assignment_group_id)
|
||||
@assignment.assignment_group = @assignment_groups.first
|
||||
|
|
|
@ -106,7 +106,7 @@ describe AssignmentsController do
|
|||
a = @course.assignments.create(:title => "some assignment")
|
||||
|
||||
get 'show', :course_id => @course.id, :id => a.id
|
||||
assigns[:assignment_groups].should_not be_nil
|
||||
assigns[:assignment_groups].should_not be_blank
|
||||
assigns[:unlocked].should_not be_nil
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue