diff --git a/test/spec/controllers/challengesCtrlSpec.js b/test/spec/controllers/challengesCtrlSpec.js index 49561238d9..b93d28ba85 100644 --- a/test/spec/controllers/challengesCtrlSpec.js +++ b/test/spec/controllers/challengesCtrlSpec.js @@ -216,13 +216,12 @@ describe('Challenges Controller', function() { value: 0, } ]; - scope.clone(copyChallenge) + scope.clone(copyChallenge); expect( scope.newChallenge.name ).to.eql( copyChallenge.name ); expect( scope.newChallenge.description ).to.eql( copyChallenge.description ); - for( var property in copyChallenge.habits[0] ) { - if ( property == "_id" || property == "id" ) { + if ( property == "_id" || property == "id" || property == "dateCreated" ) { expect( scope.newChallenge.habits[0][property] ).to.not.eql( copyChallenge.habits[0][property] ); } else { expect( scope.newChallenge.habits[0][property] ).to.eql( copyChallenge.habits[0][property] ); diff --git a/website/public/js/controllers/challengesCtrl.js b/website/public/js/controllers/challengesCtrl.js index ba284a6146..a2b743d676 100644 --- a/website/public/js/controllers/challengesCtrl.js +++ b/website/public/js/controllers/challengesCtrl.js @@ -104,7 +104,7 @@ habitrpg.controller("ChallengesCtrl", ['$rootScope','$scope', 'Shared', 'User', function cloneTask(taskToClone, index, array) { var tmpTask = {}; for( var property in taskToClone ) { - if ( property !== "_id" && property !== "id" ) { + if ( property !== "_id" && property !== "id" && property !== "dateCreated" ) { tmpTask[property] = taskToClone[property]; } }