Skip to content

Commit

Permalink
[ci skip] Close #4
Browse files Browse the repository at this point in the history
* I deleted `fixed` property from class entities of class carts.
  • Loading branch information
kyukyukyu committed Sep 20, 2013
1 parent d1e9051 commit cbe9071
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 70 deletions.
20 changes: 2 additions & 18 deletions app/scripts/services/ClassCart.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
};
Expand Down Expand Up @@ -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);
Expand All @@ -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);
});
Expand Down
9 changes: 3 additions & 6 deletions test/spec/controllers/Create.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'}
]
}
],
Expand Down Expand Up @@ -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'}
Expand All @@ -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'}
Expand All @@ -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'}
Expand Down
Loading

0 comments on commit cbe9071

Please sign in to comment.