Use index-based for loop instead of for-in in SG

Using for-in on an empty array (from test data) was pulling in Ember
properties like firstObject for some reason, which was causing a spec
failure when we tried to access those objects in the array. Stop using
for-in so that the test stops failing.

Test plan:
- Specs pass

Change-Id: If9ff1b6785b4e1f113fe0195051696c404e8e75e
Reviewed-on: https://gerrit.instructure.com/155648
Tested-by: Jenkins
Reviewed-by: Gary Mei <gmei@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
QA-Review: Indira Pai <ipai@instructure.com>
Product-Review: Adrian Packel <apackel@instructure.com>
This commit is contained in:
Adrian Packel 2018-06-28 14:43:05 -05:00
parent 73bb57555f
commit 41f0e2cf84
1 changed files with 1 additions and 1 deletions

View File

@ -876,7 +876,7 @@ function initRubricStuff(){
rubricAssessment.updateRubricAssociation($rubric, response.rubric_association);
delete response.rubric_association;
}
for (var i in EG.currentStudent.rubric_assessments) {
for (let i = 0; i < EG.currentStudent.rubric_assessments.length; i++) {
if (response.id === EG.currentStudent.rubric_assessments[i].id) {
$.extend(true, EG.currentStudent.rubric_assessments[i], response);
found = true;