From cbe9071397d63df7dc4a07579da4088cab410cc0 Mon Sep 17 00:00:00 2001 From: Sanggyu Nam Date: Fri, 20 Sep 2013 16:21:23 +0900 Subject: [PATCH] [ci skip] Close #4 * I deleted `fixed` property from class entities of class carts. --- app/scripts/services/ClassCart.js | 20 +--------- test/spec/controllers/Create.js | 9 ++--- test/spec/services/ClassCart.js | 62 ++++++++----------------------- 3 files changed, 21 insertions(+), 70 deletions(-) diff --git a/app/scripts/services/ClassCart.js b/app/scripts/services/ClassCart.js index 3e6ee06..b392e56 100644 --- a/app/scripts/services/ClassCart.js +++ b/app/scripts/services/ClassCart.js @@ -23,16 +23,9 @@ angular.module('dashApp') var hasFoundCartEntity = false; var addToClasses = function (classObj, classes) { - var fixed; - if (typeof classObj.fixed !== 'undefined') { - fixed = classObj.fixed; - } else { - fixed = false; - } var classEntity = { instructor: classObj.instructor, class_no: classObj.class_no, - fixed: fixed, time: classObj.time }; classes.push(classEntity); @@ -108,15 +101,8 @@ angular.module('dashApp') var hasFoundCartEntity = false; var addToClasses = function (classObj, classes) { - var fixed; - if (typeof classObj.fixed !== 'undefined') { - fixed = classObj.fixed; - } else { - fixed = false; - } var classEntity = { - class_no: classObj.class_no, - fixed: fixed + class_no: classObj.class_no }; classes.push(classEntity); }; @@ -217,7 +203,6 @@ angular.module('dashApp') var subsetOfClass = { instructor: classObj.instructor, class_no: classEntity.class_no, - fixed: classEntity.fixed, time: classObj.time }; gradesMapEntity.majorEntity.classes.push(subsetOfClass); @@ -243,8 +228,7 @@ angular.module('dashApp') jQuery.each(cartEntity.majors, function (majorIndex, majorEntity) { jQuery.each(majorEntity.classes, function (classIndex, classEntity) { var newClassEntity = { - class_no: classEntity.class_no, - fixed: classEntity.fixed + class_no: classEntity.class_no }; newCourseEntity.classes.push(newClassEntity); }); diff --git a/test/spec/controllers/Create.js b/test/spec/controllers/Create.js index e4fbc8a..9203fcd 100644 --- a/test/spec/controllers/Create.js +++ b/test/spec/controllers/Create.js @@ -15,9 +15,9 @@ describe('Controller: CreateCtrl', function () { placement_required: true, course_no: 'GEN253', classes: [ - {class_no: '13056', fixed: false}, - {class_no: '13057', fixed: true}, - {class_no: '10455', fixed: false} + {class_no: '13056'}, + {class_no: '13057'}, + {class_no: '10455'} ] } ], @@ -350,7 +350,6 @@ describe('Controller: CreateCtrl', function () { { instructor: null, class_no: '13056', - fixed: false, time: [ {start_time: 211, end_time: 213, room: 'H05-0103'}, {start_time: 514, end_time: 516, room: 'H05-0103'} @@ -359,7 +358,6 @@ describe('Controller: CreateCtrl', function () { { instructor: '신교일', class_no: '13057', - fixed: true, time: [ {start_time: 211, end_time: 213, room: 'H05-0202'}, {start_time: 514, end_time: 516, room: 'H05-0202'} @@ -368,7 +366,6 @@ describe('Controller: CreateCtrl', function () { { instructor: '평인수', class_no: '10455', - fixed: false, time: [ {start_time: 211, end_time: 213, room: 'H05-0203'}, {start_time: 514, end_time: 516, room: 'H05-0203'} diff --git a/test/spec/services/ClassCart.js b/test/spec/services/ClassCart.js index c2add5a..e88342c 100644 --- a/test/spec/services/ClassCart.js +++ b/test/spec/services/ClassCart.js @@ -223,9 +223,9 @@ describe('Service: ClassCart', function () { placement_required: true, course_no: 'GEN253', classes: [ - {class_no: '13056', fixed: false}, - {class_no: '13057', fixed: true}, - {class_no: '10455', fixed: false} + {class_no: '13056'}, + {class_no: '13057'}, + {class_no: '10455'} ] } ]; @@ -248,7 +248,6 @@ describe('Service: ClassCart', function () { { instructor: null, class_no: '13056', - fixed: false, time: [ {start_time: 211, end_time: 213, room: 'H05-0103'}, {start_time: 514, end_time: 516, room: 'H05-0103'} @@ -257,7 +256,6 @@ describe('Service: ClassCart', function () { { instructor: '신교일', class_no: '13057', - fixed: true, time: [ {start_time: 211, end_time: 213, room: 'H05-0202'}, {start_time: 514, end_time: 516, room: 'H05-0202'} @@ -266,7 +264,6 @@ describe('Service: ClassCart', function () { { instructor: '평인수', class_no: '10455', - fixed: false, time: [ {start_time: 211, end_time: 213, room: 'H05-0203'}, {start_time: 514, end_time: 516, room: 'H05-0203'} @@ -298,7 +295,6 @@ describe('Service: ClassCart', function () { { instructor: null, class_no: '13056', - fixed: false, time: [ {start_time: 211, end_time: 213, room: 'H05-0103'}, {start_time: 514, end_time: 516, room: 'H05-0103'} @@ -307,7 +303,6 @@ describe('Service: ClassCart', function () { { instructor: '신교일', class_no: '13057', - fixed: true, time: [ {start_time: 211, end_time: 213, room: 'H05-0202'}, {start_time: 514, end_time: 516, room: 'H05-0202'} @@ -316,7 +311,6 @@ describe('Service: ClassCart', function () { { instructor: '평인수', class_no: '10455', - fixed: false, time: [ {start_time: 211, end_time: 213, room: 'H05-0203'}, {start_time: 514, end_time: 516, room: 'H05-0203'} @@ -335,9 +329,9 @@ describe('Service: ClassCart', function () { placement_required: true, course_no: 'GEN253', classes: [ - {class_no: '13056', fixed: false}, - {class_no: '13057', fixed: true}, - {class_no: '10455', fixed: false} + {class_no: '13056'}, + {class_no: '13057'}, + {class_no: '10455'} ] } ]; @@ -364,7 +358,6 @@ describe('Service: ClassCart', function () { { instructor: null, class_no: '13056', - fixed: false, time: [ {start_time: 211, end_time: 213, room: 'H05-0103'}, {start_time: 514, end_time: 516, room: 'H05-0103'} @@ -373,7 +366,6 @@ describe('Service: ClassCart', function () { { instructor: '신교일', class_no: '13057', - fixed: true, time: [ {start_time: 211, end_time: 213, room: 'H05-0202'}, {start_time: 514, end_time: 516, room: 'H05-0202'} @@ -390,9 +382,9 @@ describe('Service: ClassCart', function () { placement_required: true, course_no: 'GEN253', classes: [ - {class_no: '13056', fixed: false}, - {class_no: '13057', fixed: true}, - {class_no: '10455', fixed: false} + {class_no: '13056'}, + {class_no: '13057'}, + {class_no: '10455'} ] } ]; @@ -412,7 +404,6 @@ describe('Service: ClassCart', function () { { instructor: null, class_no: '13056', - fixed: false, time: [ {start_time: 211, end_time: 213, room: 'H05-0103'}, {start_time: 514, end_time: 516, room: 'H05-0103'} @@ -421,7 +412,6 @@ describe('Service: ClassCart', function () { { instructor: '신교일', class_no: '13057', - fixed: true, time: [ {start_time: 211, end_time: 213, room: 'H05-0202'}, {start_time: 514, end_time: 516, room: 'H05-0202'} @@ -430,7 +420,6 @@ describe('Service: ClassCart', function () { { instructor: '평인수', class_no: '10455', - fixed: false, time: [ {start_time: 211, end_time: 213, room: 'H05-0203'}, {start_time: 514, end_time: 516, room: 'H05-0203'} @@ -471,7 +460,6 @@ describe('Service: ClassCart', function () { { instructor: null, class_no: '13056', - fixed: false, time: [ {start_time: 211, end_time: 213, room: 'H05-0103'}, {start_time: 514, end_time: 516, room: 'H05-0103'} @@ -480,7 +468,6 @@ describe('Service: ClassCart', function () { { instructor: '신교일', class_no: '13057', - fixed: true, time: [ {start_time: 211, end_time: 213, room: 'H05-0202'}, {start_time: 514, end_time: 516, room: 'H05-0202'} @@ -497,9 +484,9 @@ describe('Service: ClassCart', function () { placement_required: true, course_no: 'GEN253', classes: [ - {class_no: '13056', fixed: false}, - {class_no: '13057', fixed: true}, - {class_no: '10301', fixed: false} + {class_no: '13056'}, + {class_no: '13057'}, + {class_no: '10301'} ] } ]; @@ -519,7 +506,6 @@ describe('Service: ClassCart', function () { { instructor: null, class_no: '13056', - fixed: false, time: [ {start_time: 211, end_time: 213, room: 'H05-0103'}, {start_time: 514, end_time: 516, room: 'H05-0103'} @@ -528,7 +514,6 @@ describe('Service: ClassCart', function () { { instructor: '신교일', class_no: '13057', - fixed: true, time: [ {start_time: 211, end_time: 213, room: 'H05-0202'}, {start_time: 514, end_time: 516, room: 'H05-0202'} @@ -545,7 +530,6 @@ describe('Service: ClassCart', function () { { instructor: '박영선', class_no: '10301', - fixed: false, time: [ {start_time: 206, end_time: 208, room: 'H05-0103'}, {start_time: 403, end_time: 405, room: 'H05-0103'} @@ -578,7 +562,7 @@ describe('Service: ClassCart', function () { placement_required: true, course_no: 'GEN253', classes: [ - {class_no: '10455', fixed: false} + {class_no: '10455'} ] } ]; @@ -598,7 +582,6 @@ describe('Service: ClassCart', function () { { instructor: '평인수', class_no: '10455', - fixed: false, time: [ {start_time: 211, end_time: 213, room: 'H05-0203'}, {start_time: 514, end_time: 516, room: 'H05-0203'} @@ -639,7 +622,6 @@ describe('Service: ClassCart', function () { { instructor: null, class_no: '13056', - fixed: false, time: [ {start_time: 211, end_time: 213, room: 'H05-0103'}, {start_time: 514, end_time: 516, room: 'H05-0103'} @@ -648,7 +630,6 @@ describe('Service: ClassCart', function () { { instructor: '신교일', class_no: '13057', - fixed: true, time: [ {start_time: 211, end_time: 213, room: 'H05-0202'}, {start_time: 514, end_time: 516, room: 'H05-0202'} @@ -665,7 +646,7 @@ describe('Service: ClassCart', function () { placement_required: true, course_no: 'GEN253', classes: [ - {class_no: '13057', fixed: true} + {class_no: '13057'} ] } ]; @@ -685,7 +666,6 @@ describe('Service: ClassCart', function () { { instructor: '신교일', class_no: '13057', - fixed: true, time: [ {start_time: 211, end_time: 213, room: 'H05-0202'}, {start_time: 514, end_time: 516, room: 'H05-0202'} @@ -723,7 +703,6 @@ describe('Service: ClassCart', function () { { instructor: null, class_no: '13056', - fixed: false, time: [ {start_time: 211, end_time: 213, room: 'H05-0103'}, {start_time: 514, end_time: 516, room: 'H05-0103'} @@ -740,7 +719,6 @@ describe('Service: ClassCart', function () { { instructor: '박영선', class_no: '10301', - fixed: false, time: [ {start_time: 206, end_time: 208, room: 'H05-0103'}, {start_time: 403, end_time: 405, room: 'H05-0103'} @@ -757,7 +735,7 @@ describe('Service: ClassCart', function () { placement_required: true, course_no: 'GEN253', classes: [ - {class_no: '13056', fixed: false} + {class_no: '13056'} ] } ]; @@ -777,7 +755,6 @@ describe('Service: ClassCart', function () { { instructor: null, class_no: '13056', - fixed: false, time: [ {start_time: 211, end_time: 213, room: 'H05-0103'}, {start_time: 514, end_time: 516, room: 'H05-0103'} @@ -815,7 +792,6 @@ describe('Service: ClassCart', function () { { instructor: null, class_no: '13056', - fixed: false, time: [ {start_time: 211, end_time: 213, room: 'H05-0103'}, {start_time: 514, end_time: 516, room: 'H05-0103'} @@ -857,7 +833,6 @@ describe('Service: ClassCart', function () { { instructor: null, class_no: '13056', - fixed: false, time: [ {start_time: 211, end_time: 213, room: 'H05-0103'}, {start_time: 514, end_time: 516, room: 'H05-0103'} @@ -874,7 +849,6 @@ describe('Service: ClassCart', function () { { instructor: '박영선', class_no: '10301', - fixed: false, time: [ {start_time: 206, end_time: 208, room: 'H05-0103'}, {start_time: 403, end_time: 405, room: 'H05-0103'} @@ -891,7 +865,7 @@ describe('Service: ClassCart', function () { placement_required: true, course_no: 'GEN253', classes: [ - {class_no: '13056', fixed: false} + {class_no: '13056'} ] } ]; @@ -911,7 +885,6 @@ describe('Service: ClassCart', function () { { instructor: null, class_no: '13056', - fixed: false, time: [ {start_time: 211, end_time: 213, room: 'H05-0103'}, {start_time: 514, end_time: 516, room: 'H05-0103'} @@ -949,7 +922,6 @@ describe('Service: ClassCart', function () { { instructor: null, class_no: '13056', - fixed: false, time: [ {start_time: 211, end_time: 213, room: 'H05-0103'}, {start_time: 514, end_time: 516, room: 'H05-0103'} @@ -989,7 +961,6 @@ describe('Service: ClassCart', function () { { instructor: null, class_no: '13056', - fixed: false, time: [ {start_time: 211, end_time: 213, room: 'H05-0103'}, {start_time: 514, end_time: 516, room: 'H05-0103'} @@ -1006,7 +977,6 @@ describe('Service: ClassCart', function () { { instructor: '박영선', class_no: '10301', - fixed: false, time: [ {start_time: 206, end_time: 208, room: 'H05-0103'}, {start_time: 403, end_time: 405, room: 'H05-0103'}