canvas-lms/spec/presenters
Strand McCutchen 6ff48eb015 guard grade_distribution to fix error on concluded student's grade page
fixes CNVS-17901

The GradeSummaryAssignmentPresenter#grade_distribution would throw an error
when it was triggered with a concluded student, because its call to
GradeSummaryPresenter#assignment_stats returned an empty hash, instead of one
which contains the assignment's id as a key. A NoMethodError was triggered off
of a nil provided by the hash.

To fix this, I wrapped the offending code in an if clause to guard against this
case.

Test Plan:

1. Create a published course that has a student and at least 1 graded assignment
2. Give the student a grade for the assignment
3. Conclude the student's enrollment on the course's user show page
4. Go to the course people page and select "View Prior Enrollments"
5. Select the grade under the Total column for the concluded student
6. Confirm that the page loads and displays a grade.

Change-Id: I1bb6b4ba4b64ccdb976634fd68b916f1814b539d
Reviewed-on: https://gerrit.instructure.com/48001
Tested-by: Jenkins
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Strand McCutchen <smccutchen@instructure.com>
2015-02-03 00:37:29 +00:00
..
quizzes remove non-draft-state everything 2014-12-10 17:57:18 +00:00
discussion_topic_presenter_spec.rb remove non-draft-state everything 2014-12-10 17:57:18 +00:00
grade_summary_assignment_presenter_spec.rb guard grade_distribution to fix error on concluded student's grade page 2015-02-03 00:37:29 +00:00
grade_summary_presenter_spec.rb DA - remove filter from assignment_stats 2015-01-05 21:34:46 +00:00
grades_presenter_spec.rb rspec 3-ify spec/presenters 2014-10-13 23:12:43 +00:00
override_list_presenter_spec.rb rspec 3-ify spec/presenters 2014-10-13 23:12:43 +00:00
override_tooltip_presenter_spec.rb rspec 3-ify spec/presenters 2014-10-13 23:12:43 +00:00