@@ -52,7 +52,7 @@ describe('plugin:cache', function() {
52
52
it ( 'should getProblems w/ cache ok' , function ( done ) {
53
53
cache . set ( 'problems' , PROBLEMS ) ;
54
54
55
- plugin . getProblems ( function ( e , problems ) {
55
+ plugin . getProblems ( false , function ( e , problems ) {
56
56
assert . equal ( e , null ) ;
57
57
assert . deepEqual ( problems , PROBLEMS ) ;
58
58
done ( ) ;
@@ -61,9 +61,9 @@ describe('plugin:cache', function() {
61
61
62
62
it ( 'should getProblems w/o cache ok' , function ( done ) {
63
63
cache . del ( 'problems' ) ;
64
- next . getProblems = cb => cb ( null , PROBLEMS ) ;
64
+ next . getProblems = ( needT , cb ) => cb ( null , PROBLEMS ) ;
65
65
66
- plugin . getProblems ( function ( e , problems ) {
66
+ plugin . getProblems ( false , function ( e , problems ) {
67
67
assert . equal ( e , null ) ;
68
68
assert . deepEqual ( problems , PROBLEMS ) ;
69
69
done ( ) ;
@@ -72,9 +72,9 @@ describe('plugin:cache', function() {
72
72
73
73
it ( 'should getProblems w/o cache fail if client error' , function ( done ) {
74
74
cache . del ( 'problems' ) ;
75
- next . getProblems = cb => cb ( 'client getProblems error' ) ;
75
+ next . getProblems = ( needT , cb ) => cb ( 'client getProblems error' ) ;
76
76
77
- plugin . getProblems ( function ( e , problems ) {
77
+ plugin . getProblems ( false , function ( e , problems ) {
78
78
assert . equal ( e , 'client getProblems error' ) ;
79
79
done ( ) ;
80
80
} ) ;
@@ -86,7 +86,7 @@ describe('plugin:cache', function() {
86
86
cache . set ( 'problems' , PROBLEMS ) ;
87
87
cache . set ( '0.slug0.algorithms' , PROBLEMS [ 0 ] ) ;
88
88
89
- plugin . getProblem ( _ . clone ( PROBLEM ) , function ( e , problem ) {
89
+ plugin . getProblem ( _ . clone ( PROBLEM ) , false , function ( e , problem ) {
90
90
assert . equal ( e , null ) ;
91
91
assert . deepEqual ( problem , PROBLEMS [ 0 ] ) ;
92
92
done ( ) ;
@@ -96,9 +96,9 @@ describe('plugin:cache', function() {
96
96
it ( 'should getProblem w/o cache ok' , function ( done ) {
97
97
cache . set ( 'problems' , PROBLEMS ) ;
98
98
cache . del ( '0.slug0.algorithms' ) ;
99
- next . getProblem = ( problem , cb ) => cb ( null , PROBLEMS [ 0 ] ) ;
99
+ next . getProblem = ( problem , needT , cb ) => cb ( null , PROBLEMS [ 0 ] ) ;
100
100
101
- plugin . getProblem ( _ . clone ( PROBLEM ) , function ( e , problem ) {
101
+ plugin . getProblem ( _ . clone ( PROBLEM ) , false , function ( e , problem ) {
102
102
assert . equal ( e , null ) ;
103
103
assert . deepEqual ( problem , PROBLEMS [ 0 ] ) ;
104
104
done ( ) ;
@@ -108,9 +108,9 @@ describe('plugin:cache', function() {
108
108
it ( 'should getProblem fail if client error' , function ( done ) {
109
109
cache . set ( 'problems' , PROBLEMS ) ;
110
110
cache . del ( '0.slug0.algorithms' ) ;
111
- next . getProblem = ( problem , cb ) => cb ( 'client getProblem error' ) ;
111
+ next . getProblem = ( problem , needT , cb ) => cb ( 'client getProblem error' ) ;
112
112
113
- plugin . getProblem ( _ . clone ( PROBLEM ) , function ( e , problem ) {
113
+ plugin . getProblem ( _ . clone ( PROBLEM ) , false , function ( e , problem ) {
114
114
assert . equal ( e , 'client getProblem error' ) ;
115
115
done ( ) ;
116
116
} ) ;
@@ -140,7 +140,7 @@ describe('plugin:cache', function() {
140
140
const ret = plugin . updateProblem ( PROBLEMS [ 0 ] , kv ) ;
141
141
assert . equal ( ret , true ) ;
142
142
143
- plugin . getProblems ( function ( e , problems ) {
143
+ plugin . getProblems ( false , function ( e , problems ) {
144
144
assert . equal ( e , null ) ;
145
145
assert . deepEqual ( problems , [
146
146
{ id : 0 , fid : 0 , name : 'name0' , slug : 'slug0' , value : 'value00' , starred : false , desc : '<pre></pre>' , likes : '1' , dislikes : '1' , category : 'algorithms' } ,
0 commit comments