mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Switch channel filters to use strings not literals
fixes #6247 - GQL has a bug where literals starting with numbers are incorrectly parsed - Using strings instead of literals is a workaround, but is probably safer anyway
This commit is contained in:
parent
968349236d
commit
20f102808a
2 changed files with 4 additions and 4 deletions
|
@ -13,7 +13,7 @@ getConfig = function getConfig(name) {
|
||||||
name: 'tag',
|
name: 'tag',
|
||||||
route: '/' + config.routeKeywords.tag + '/:slug/',
|
route: '/' + config.routeKeywords.tag + '/:slug/',
|
||||||
postOptions: {
|
postOptions: {
|
||||||
filter: 'tags:%s'
|
filter: 'tags:\'%s\''
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
tag: {
|
tag: {
|
||||||
|
@ -28,7 +28,7 @@ getConfig = function getConfig(name) {
|
||||||
name: 'author',
|
name: 'author',
|
||||||
route: '/' + config.routeKeywords.author + '/:slug/',
|
route: '/' + config.routeKeywords.author + '/:slug/',
|
||||||
postOptions: {
|
postOptions: {
|
||||||
filter: 'author:%s'
|
filter: 'author:\'%s\''
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
author: {
|
author: {
|
||||||
|
|
|
@ -304,7 +304,7 @@ describe('RSS', function () {
|
||||||
// test
|
// test
|
||||||
res.send = function send(xmlData) {
|
res.send = function send(xmlData) {
|
||||||
apiBrowseStub.calledOnce.should.be.true;
|
apiBrowseStub.calledOnce.should.be.true;
|
||||||
apiBrowseStub.calledWith({page: 1, filter: 'tags:magic', include: 'author,tags,fields'}).should.be.true;
|
apiBrowseStub.calledWith({page: 1, filter: 'tags:\'magic\'', include: 'author,tags,fields'}).should.be.true;
|
||||||
apiTagStub.calledOnce.should.be.true;
|
apiTagStub.calledOnce.should.be.true;
|
||||||
xmlData.should.match(/<channel><title><!\[CDATA\[Magic - Test\]\]><\/title>/);
|
xmlData.should.match(/<channel><title><!\[CDATA\[Magic - Test\]\]><\/title>/);
|
||||||
done();
|
done();
|
||||||
|
@ -322,7 +322,7 @@ describe('RSS', function () {
|
||||||
// test
|
// test
|
||||||
res.send = function send(xmlData) {
|
res.send = function send(xmlData) {
|
||||||
apiBrowseStub.calledOnce.should.be.true;
|
apiBrowseStub.calledOnce.should.be.true;
|
||||||
apiBrowseStub.calledWith({page: 1, filter: 'author:joe', include: 'author,tags,fields'}).should.be.true;
|
apiBrowseStub.calledWith({page: 1, filter: 'author:\'joe\'', include: 'author,tags,fields'}).should.be.true;
|
||||||
apiUserStub.calledOnce.should.be.true;
|
apiUserStub.calledOnce.should.be.true;
|
||||||
xmlData.should.match(/<channel><title><!\[CDATA\[Joe Blogs - Test\]\]><\/title>/);
|
xmlData.should.match(/<channel><title><!\[CDATA\[Joe Blogs - Test\]\]><\/title>/);
|
||||||
done();
|
done();
|
||||||
|
|
Loading…
Reference in a new issue