@@ -111,8 +111,8 @@ describe('core', function() {
111111
112112 describe ( '#problems' , function ( ) {
113113 var PROBLEMS = [
114- { id : 0 , name : 'name0' , key : 'key0 ' , starred : false } ,
115- { id : 1 , name : 'name1' , key : 'key1 ' , starred : true }
114+ { id : 0 , name : 'name0' , slug : 'slug0 ' , starred : false } ,
115+ { id : 1 , name : 'name1' , slug : 'slug1 ' , starred : true }
116116 ] ;
117117 var RESULTS = [
118118 { name : 'result0' } ,
@@ -161,7 +161,7 @@ describe('core', function() {
161161 describe ( '#getProblem' , function ( ) {
162162 it ( 'should getProblem by id w/ cache ok' , function ( done ) {
163163 cache . set ( 'all' , PROBLEMS ) ;
164- cache . set ( 'key0 ' , PROBLEMS [ 0 ] ) ;
164+ cache . set ( 'slug0 ' , PROBLEMS [ 0 ] ) ;
165165
166166 core . getProblem ( 0 , function ( e , problem ) {
167167 assert . equal ( e , null ) ;
@@ -172,7 +172,7 @@ describe('core', function() {
172172
173173 it ( 'should getProblem by name w/ cache ok' , function ( done ) {
174174 cache . set ( 'all' , PROBLEMS ) ;
175- cache . set ( 'key0 ' , PROBLEMS [ 0 ] ) ;
175+ cache . set ( 'slug0 ' , PROBLEMS [ 0 ] ) ;
176176
177177 core . getProblem ( 'name0' , function ( e , problem ) {
178178 assert . equal ( e , null ) ;
@@ -183,9 +183,9 @@ describe('core', function() {
183183
184184 it ( 'should getProblem by key w/ cache ok' , function ( done ) {
185185 cache . set ( 'all' , PROBLEMS ) ;
186- cache . set ( 'key0 ' , PROBLEMS [ 0 ] ) ;
186+ cache . set ( 'slug0 ' , PROBLEMS [ 0 ] ) ;
187187
188- core . getProblem ( 'key0 ' , function ( e , problem ) {
188+ core . getProblem ( 'slug0 ' , function ( e , problem ) {
189189 assert . equal ( e , null ) ;
190190 assert . deepEqual ( problem , PROBLEMS [ 0 ] ) ;
191191 done ( ) ;
@@ -194,7 +194,7 @@ describe('core', function() {
194194
195195 it ( 'should getProblem by id w/o cache ok' , function ( done ) {
196196 cache . set ( 'all' , PROBLEMS ) ;
197- cache . del ( 'key0 ' ) ;
197+ cache . del ( 'slug0 ' ) ;
198198
199199 client . getProblem = function ( user , problem , cb ) {
200200 return cb ( null , problem ) ;
@@ -218,7 +218,7 @@ describe('core', function() {
218218
219219 it ( 'should getProblem fail if client error' , function ( done ) {
220220 cache . set ( 'all' , PROBLEMS ) ;
221- cache . del ( 'key0 ' ) ;
221+ cache . del ( 'slug0 ' ) ;
222222
223223 client . getProblem = function ( user , problem , cb ) {
224224 return cb ( 'client getProblem error' ) ;
@@ -246,7 +246,7 @@ describe('core', function() {
246246 describe ( '#updateProblem' , function ( ) {
247247 it ( 'should updateProblem ok' , function ( done ) {
248248 cache . set ( 'all' , PROBLEMS ) ;
249- cache . del ( 'key0 ' ) ;
249+ cache . del ( 'slug0 ' ) ;
250250
251251 var kv = { value : 'value00' } ;
252252 var ret = core . updateProblem ( PROBLEMS [ 0 ] , kv ) ;
@@ -255,7 +255,7 @@ describe('core', function() {
255255 core . getProblem ( 0 , function ( e , problem ) {
256256 assert . equal ( e , null ) ;
257257 assert . deepEqual ( problem ,
258- { id : 0 , name : 'name0' , key : 'key0 ' , value : 'value00' , starred : false } ) ;
258+ { id : 0 , name : 'name0' , slug : 'slug0 ' , value : 'value00' , starred : false } ) ;
259259 done ( ) ;
260260 } ) ;
261261 } ) ;
0 commit comments