You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updated post filter test bindings for normalized date format
The date-filter normalization rewrites bare date filter values to the
stored `YYYY-MM-DD HH:MM:SS` format, so the existing query-binding
assertions for `published_at:>'2015-07-20'` now expect
`2015-07-20 00:00:00`.
Copy file name to clipboardExpand all lines: ghost/core/test/unit/server/models/post.test.js
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -115,14 +115,14 @@ describe('Unit: models/post', function () {
115
115
assert.equal(queries.length,2);
116
116
assert.equal(queries[0].sql,'select count(distinct posts.id) as aggregate from `posts` where (`posts`.`published_at` > ? and (`posts`.`type` = ? and `posts`.`status` = ?))');
117
117
assert.deepEqual(queries[0].bindings,[
118
-
'2015-07-20',
118
+
'2015-07-20 00:00:00',
119
119
'post',
120
120
'published'
121
121
]);
122
122
123
123
assert.equal(queries[1].sql,'select `posts`.* from `posts` where (`posts`.`published_at` > ? and (`posts`.`type` = ? and `posts`.`status` = ?)) order by CASE WHEN posts.status = \'scheduled\' THEN 1 WHEN posts.status = \'draft\' THEN 2 ELSE 3 END ASC,CASE WHEN posts.status != \'draft\' THEN posts.published_at END DESC,posts.updated_at DESC,posts.id DESC limit ?');
124
124
assert.deepEqual(queries[1].bindings,[
125
-
'2015-07-20',
125
+
'2015-07-20 00:00:00',
126
126
'post',
127
127
'published',
128
128
5
@@ -148,7 +148,7 @@ describe('Unit: models/post', function () {
148
148
assert.equal(queries.length,1);
149
149
assert.equal(queries[0].sql,'select `posts`.* from `posts` where (`posts`.`published_at` > ? and (`posts`.`type` = ? and `posts`.`status` = ?)) order by CASE WHEN posts.status = \'scheduled\' THEN 1 WHEN posts.status = \'draft\' THEN 2 ELSE 3 END ASC,CASE WHEN posts.status != \'draft\' THEN posts.published_at END DESC,posts.updated_at DESC,posts.id DESC limit ?');
150
150
assert.deepEqual(queries[0].bindings,[
151
-
'2015-07-20',
151
+
'2015-07-20 00:00:00',
152
152
'post',
153
153
'published',
154
154
1
@@ -176,7 +176,7 @@ describe('Unit: models/post', function () {
176
176
assert.equal(queries.length,1);
177
177
assert.equal(queries[0].sql,'select `posts`.* from `posts` where (`posts`.`published_at` > ? and (`posts`.`type` = ? and `posts`.`status` = ?)) order by CASE WHEN posts.status = \'scheduled\' THEN 1 WHEN posts.status = \'draft\' THEN 2 ELSE 3 END ASC,CASE WHEN posts.status != \'draft\' THEN posts.published_at END DESC,posts.updated_at DESC,posts.id DESC limit ?');
0 commit comments