@@ -19,29 +19,24 @@ it("insert query for text action", function() {
19
19
console . log ( util . inspect ( query , {
20
20
depth : 4
21
21
} ) ) ;
22
- assert . deepEqual ( query , [ {
23
- '$' : 'INSERT INTO "texts" ( "id", "from", "to", "time", "text", "thread", "title", "tags", "mentions", "upvoters", "flaggers", "updatetime", "updater" ) VALUES ( ${id}, ${from}, ${to}, ${time}, ${text}, ${thread}, ${title}, ${tags}, ${mentions}, ${upvoters}, ${flaggers}, ${updatetime}, ${updater} )' ,
24
- id : 'sasw4efsdewrewrrcdswerewqwe3432' ,
25
- from : 'testinguser' ,
26
- to : 'scrollback' ,
27
- time : new Date ( 1433852225717 ) ,
28
- text : 'testing message' ,
29
- thread : '32332hhhkhh23h3h2g432hg42' ,
30
- title : undefined ,
31
- tags : [ ] ,
32
- mentions : undefined ,
33
- upvoters : [ ] ,
34
- flaggers : [ ] ,
35
- updatetime : new Date ( 1433852225717 ) ,
36
- updater : 'testinguser'
37
- } ,
38
- {
39
- '$' : 'UPDATE threads SET updatetime=${updatetime}, updater=${updater}, length=length+1, concerns = concerns || (SELECT array_agg(a.n) FROM (VALUES $(concerns)) AS a(n) WHERE NOT (threads.concerns @> ARRAY[a.n])) WHERE id=${id}' ,
40
- updatetime : new Date ( 1433852225717 ) ,
41
- updater : 'testinguser' ,
42
- concerns : [ [ 'testinguser' ] , [ undefined ] ] ,
43
- id : '32332hhhkhh23h3h2g432hg42'
44
- } ] , "wrong query for text action" ) ;
22
+ assert . deepEqual ( query , [ { '$' : 'INSERT INTO "texts" ( "id", "from", "to", "time", "text", "thread", "title", "tags", "mentions", "upvoters", "flaggers", "updatetime", "updater" ) VALUES ( ${id}, ${from}, ${to}, ${time}, ${text}, ${thread}, ${title}, ${tags}, ${mentions}, ${upvoters}, ${flaggers}, ${updatetime}, ${updater} )' ,
23
+ id : 'sasw4efsdewrewrrcdswerewqwe3432' ,
24
+ from : 'testinguser' ,
25
+ to : 'scrollback' ,
26
+ time : new Date ( 1433852225717 ) ,
27
+ text : 'testing message' ,
28
+ thread : '32332hhhkhh23h3h2g432hg42' ,
29
+ title : undefined ,
30
+ tags : [ ] ,
31
+ mentions : undefined ,
32
+ upvoters : [ ] ,
33
+ flaggers : [ ] ,
34
+ updatetime : new Date ( 1433852225717 ) ,
35
+ updater : 'testinguser' } ,
36
+ { '$' : 'UPDATE threads SET updatetime=${updatetime}, updater=${updater}, length=length+1 WHERE id=${id}' ,
37
+ updatetime : new Date ( 1433852225717 ) ,
38
+ updater : 'testinguser' ,
39
+ id : '32332hhhkhh23h3h2g432hg42' } ] , "wrong query for text action" ) ;
45
40
} ) ;
46
41
47
42
it ( "query for edit action(text)" , function ( ) {
@@ -56,8 +51,8 @@ it("query for edit action(text)", function() {
56
51
console . log ( util . inspect ( query , {
57
52
depth : 4
58
53
} ) ) ;
59
- assert . deepEqual ( query , [ { '$' : 'UPDATE "texts" SET "updateTime "=${updateTime }, "text"=${text} WHERE id=${id}' ,
60
- updateTime : new Date ( 1433852225717 ) ,
54
+ assert . deepEqual ( query , [ { '$' : 'UPDATE "texts" SET "updatetime "=${updatetime }, "text"=${text} WHERE id=${id}' ,
55
+ updatetime : new Date ( 1433852225717 ) ,
61
56
text : 'edit testing message' ,
62
57
id : undefined } ] , "wrong Query for editing a text" ) ;
63
58
} ) ;
@@ -74,12 +69,12 @@ it("query for edit action(tags)", function() {
74
69
console . log ( util . inspect ( query , {
75
70
depth : 4
76
71
} ) ) ;
77
- assert . deepEqual ( query , [ { '$' : 'UPDATE "texts" SET "updateTime "=${updateTime }, "tags"=${tags} WHERE id=${id}' ,
78
- updateTime : new Date ( 1433852225717 ) ,
72
+ assert . deepEqual ( query , [ { '$' : 'UPDATE "texts" SET "updatetime "=${updatetime }, "tags"=${tags} WHERE id=${id}' ,
73
+ updatetime : new Date ( 1433852225717 ) ,
79
74
tags : [ 'hidden' ] ,
80
75
id : undefined } ,
81
- { '$' : 'UPDATE "threads" SET "updateTime "=${updateTime }, "tags"=${tags} WHERE id=${id}' ,
82
- updateTime : new Date ( 1433852225717 ) ,
76
+ { '$' : 'UPDATE "threads" SET "updatetime "=${updatetime }, "tags"=${tags} WHERE id=${id}' ,
77
+ updatetime : new Date ( 1433852225717 ) ,
83
78
tags : [ 'hidden' ] ,
84
79
id : undefined } ] , "wrong Query for editing tag" ) ;
85
80
} ) ;
@@ -98,12 +93,12 @@ it("query for edit action(title with tags)", function() {
98
93
console . log ( util . inspect ( query , {
99
94
depth : 4
100
95
} ) ) ;
101
- assert . deepEqual ( query , [ { '$' : 'UPDATE "texts" SET "updateTime "=${updateTime }, "tags"=${tags} WHERE id=${id}' ,
102
- updateTime : new Date ( 1433852225717 ) ,
96
+ assert . deepEqual ( query , [ { '$' : 'UPDATE "texts" SET "updatetime "=${updatetime }, "tags"=${tags} WHERE id=${id}' ,
97
+ updatetime : new Date ( 1433852225717 ) ,
103
98
tags : [ 'abbusive' ] ,
104
99
id : '324hhg382t43g4372g4u324' } ,
105
- { '$' : 'UPDATE "threads" SET "updateTime "=${updateTime }, "title"=${title}, "tags"=${tags} WHERE id=${id}' ,
106
- updateTime : new Date ( 1433852225717 ) ,
100
+ { '$' : 'UPDATE "threads" SET "updatetime "=${updatetime }, "title"=${title}, "tags"=${tags} WHERE id=${id}' ,
101
+ updatetime : new Date ( 1433852225717 ) ,
107
102
title : 'editing the tittle' ,
108
103
tags : [ 'abbusive' ] ,
109
104
id : '324hhg382t43g4372g4u324' } ] , "wrong Query for editing a title" ) ;
@@ -122,8 +117,8 @@ it("query for edit action(title)", function() {
122
117
console . log ( util . inspect ( query , {
123
118
depth : 4
124
119
} ) ) ;
125
- assert . deepEqual ( query , [ { '$' : 'UPDATE "threads" SET "updateTime "=${updateTime }, "title"=${title} WHERE id=${id}' ,
126
- updateTime : new Date ( 1433852225717 ) ,
120
+ assert . deepEqual ( query , [ { '$' : 'UPDATE "threads" SET "updatetime "=${updatetime }, "title"=${title} WHERE id=${id}' ,
121
+ updatetime : new Date ( 1433852225717 ) ,
127
122
title : 'editing the tittle' ,
128
123
id : '324hhg382t43g4372g4u324' } ] , "wrong Query for editing a title" ) ;
129
124
} ) ;
0 commit comments