@@ -111,8 +111,8 @@ describe('core', function() {
111
111
112
112
describe ( '#problems' , function ( ) {
113
113
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 }
116
116
] ;
117
117
var RESULTS = [
118
118
{ name : 'result0' } ,
@@ -161,7 +161,7 @@ describe('core', function() {
161
161
describe ( '#getProblem' , function ( ) {
162
162
it ( 'should getProblem by id w/ cache ok' , function ( done ) {
163
163
cache . set ( 'all' , PROBLEMS ) ;
164
- cache . set ( 'key0 ' , PROBLEMS [ 0 ] ) ;
164
+ cache . set ( 'slug0 ' , PROBLEMS [ 0 ] ) ;
165
165
166
166
core . getProblem ( 0 , function ( e , problem ) {
167
167
assert . equal ( e , null ) ;
@@ -172,7 +172,7 @@ describe('core', function() {
172
172
173
173
it ( 'should getProblem by name w/ cache ok' , function ( done ) {
174
174
cache . set ( 'all' , PROBLEMS ) ;
175
- cache . set ( 'key0 ' , PROBLEMS [ 0 ] ) ;
175
+ cache . set ( 'slug0 ' , PROBLEMS [ 0 ] ) ;
176
176
177
177
core . getProblem ( 'name0' , function ( e , problem ) {
178
178
assert . equal ( e , null ) ;
@@ -183,9 +183,9 @@ describe('core', function() {
183
183
184
184
it ( 'should getProblem by key w/ cache ok' , function ( done ) {
185
185
cache . set ( 'all' , PROBLEMS ) ;
186
- cache . set ( 'key0 ' , PROBLEMS [ 0 ] ) ;
186
+ cache . set ( 'slug0 ' , PROBLEMS [ 0 ] ) ;
187
187
188
- core . getProblem ( 'key0 ' , function ( e , problem ) {
188
+ core . getProblem ( 'slug0 ' , function ( e , problem ) {
189
189
assert . equal ( e , null ) ;
190
190
assert . deepEqual ( problem , PROBLEMS [ 0 ] ) ;
191
191
done ( ) ;
@@ -194,7 +194,7 @@ describe('core', function() {
194
194
195
195
it ( 'should getProblem by id w/o cache ok' , function ( done ) {
196
196
cache . set ( 'all' , PROBLEMS ) ;
197
- cache . del ( 'key0 ' ) ;
197
+ cache . del ( 'slug0 ' ) ;
198
198
199
199
client . getProblem = function ( user , problem , cb ) {
200
200
return cb ( null , problem ) ;
@@ -218,7 +218,7 @@ describe('core', function() {
218
218
219
219
it ( 'should getProblem fail if client error' , function ( done ) {
220
220
cache . set ( 'all' , PROBLEMS ) ;
221
- cache . del ( 'key0 ' ) ;
221
+ cache . del ( 'slug0 ' ) ;
222
222
223
223
client . getProblem = function ( user , problem , cb ) {
224
224
return cb ( 'client getProblem error' ) ;
@@ -246,7 +246,7 @@ describe('core', function() {
246
246
describe ( '#updateProblem' , function ( ) {
247
247
it ( 'should updateProblem ok' , function ( done ) {
248
248
cache . set ( 'all' , PROBLEMS ) ;
249
- cache . del ( 'key0 ' ) ;
249
+ cache . del ( 'slug0 ' ) ;
250
250
251
251
var kv = { value : 'value00' } ;
252
252
var ret = core . updateProblem ( PROBLEMS [ 0 ] , kv ) ;
@@ -255,7 +255,7 @@ describe('core', function() {
255
255
core . getProblem ( 0 , function ( e , problem ) {
256
256
assert . equal ( e , null ) ;
257
257
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 } ) ;
259
259
done ( ) ;
260
260
} ) ;
261
261
} ) ;
0 commit comments