mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Swapped etag matcher to always be anyEtag
- some tests were using anyString, but we have a more specific matcher available - it's best to use the most specific matcher possible
This commit is contained in:
parent
5e441d0942
commit
857464c104
6 changed files with 29 additions and 29 deletions
|
@ -6,7 +6,7 @@ Object {
|
|||
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
|
||||
"content-length": "7",
|
||||
"content-type": "text/plain; charset=utf-8",
|
||||
"etag": Any<String>,
|
||||
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
|
||||
"set-cookie": Array [
|
||||
StringMatching /\\^ghost-admin-api-session=/,
|
||||
],
|
||||
|
@ -19,7 +19,7 @@ exports[`Sessions API can delete session (log out) 1: [headers] 1`] = `
|
|||
Object {
|
||||
"access-control-allow-origin": "http://127.0.0.1:2369",
|
||||
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
|
||||
"etag": Any<String>,
|
||||
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
|
||||
"vary": "Origin",
|
||||
"x-powered-by": "Express",
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ Object {
|
|||
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
|
||||
"content-length": "515",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"etag": Any<String>,
|
||||
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
|
||||
"vary": "Origin, Accept-Encoding",
|
||||
"x-powered-by": "Express",
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ Object {
|
|||
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
|
||||
"content-length": "321",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"etag": Any<String>,
|
||||
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
|
||||
"vary": "Origin, Accept-Encoding",
|
||||
"x-powered-by": "Express",
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ Object {
|
|||
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
|
||||
"content-length": "167",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"etag": Any<String>,
|
||||
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
|
||||
"vary": "Origin, Accept-Encoding",
|
||||
"x-powered-by": "Express",
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
const {agentProvider, fixtureManager, matchers} = require('../../utils/e2e-framework');
|
||||
const {anyString, anyErrorId, stringMatching, anyISODateTime} = matchers;
|
||||
const {anyEtag, anyErrorId, stringMatching, anyISODateTime} = matchers;
|
||||
|
||||
describe('Sessions API', function () {
|
||||
let agent;
|
||||
|
@ -21,7 +21,7 @@ describe('Sessions API', function () {
|
|||
.expectStatus(201)
|
||||
.expectEmptyBody()
|
||||
.matchHeaderSnapshot({
|
||||
etag: anyString,
|
||||
etag: anyEtag,
|
||||
'set-cookie': [
|
||||
stringMatching(/^ghost-admin-api-session=/)
|
||||
]
|
||||
|
@ -39,7 +39,7 @@ describe('Sessions API', function () {
|
|||
updated_at: anyISODateTime
|
||||
})
|
||||
.matchHeaderSnapshot({
|
||||
etag: anyString
|
||||
etag: anyEtag
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -49,7 +49,7 @@ describe('Sessions API', function () {
|
|||
.expectStatus(204)
|
||||
.expectEmptyBody()
|
||||
.matchHeaderSnapshot({
|
||||
etag: anyString
|
||||
etag: anyEtag
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -63,7 +63,7 @@ describe('Sessions API', function () {
|
|||
}]
|
||||
})
|
||||
.matchHeaderSnapshot({
|
||||
etag: anyString
|
||||
etag: anyEtag
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
const {agentProvider, matchers} = require('../../utils/e2e-framework');
|
||||
const {anyString, stringMatching} = matchers;
|
||||
const {anyEtag, stringMatching} = matchers;
|
||||
|
||||
describe('Site API', function () {
|
||||
let agent;
|
||||
|
@ -17,7 +17,7 @@ describe('Site API', function () {
|
|||
}
|
||||
})
|
||||
.matchHeaderSnapshot({
|
||||
etag: anyString
|
||||
etag: anyEtag
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -56,7 +56,7 @@ Object {
|
|||
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
|
||||
"content-length": "224",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"etag": Any<String>,
|
||||
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
|
||||
"vary": "Origin, Accept-Encoding",
|
||||
"x-powered-by": "Express",
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ Object {
|
|||
"content-length": "167",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/,
|
||||
"etag": Any<String>,
|
||||
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
|
||||
"vary": "Origin, Accept-Encoding",
|
||||
"x-powered-by": "Express",
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ Object {
|
|||
"content-length": "167",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/,
|
||||
"etag": Any<String>,
|
||||
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
|
||||
"vary": "Origin, Accept-Encoding",
|
||||
"x-powered-by": "Express",
|
||||
}
|
||||
|
@ -139,7 +139,7 @@ Object {
|
|||
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
|
||||
"content-length": "354",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"etag": Any<String>,
|
||||
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
|
||||
"vary": "Origin, Accept-Encoding",
|
||||
"x-powered-by": "Express",
|
||||
}
|
||||
|
@ -168,7 +168,7 @@ Object {
|
|||
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
|
||||
"content-length": "354",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"etag": Any<String>,
|
||||
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
|
||||
"vary": "Origin, Accept-Encoding",
|
||||
"x-powered-by": "Express",
|
||||
}
|
||||
|
@ -197,7 +197,7 @@ Object {
|
|||
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
|
||||
"content-length": "348",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"etag": Any<String>,
|
||||
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
|
||||
"vary": "Origin, Accept-Encoding",
|
||||
"x-powered-by": "Express",
|
||||
}
|
||||
|
@ -226,7 +226,7 @@ Object {
|
|||
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
|
||||
"content-length": "354",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"etag": Any<String>,
|
||||
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
|
||||
"vary": "Origin, Accept-Encoding",
|
||||
"x-powered-by": "Express",
|
||||
}
|
||||
|
@ -252,7 +252,7 @@ Object {
|
|||
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
|
||||
"content-length": "167",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"etag": Any<String>,
|
||||
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
|
||||
"vary": "Origin, Accept-Encoding",
|
||||
"x-powered-by": "Express",
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
const {agentProvider, fixtureManager, matchers, mockManager} = require('../../utils/e2e-framework');
|
||||
const {anyErrorId, anyString, stringMatching, anyLocationFor} = matchers;
|
||||
const {anyErrorId, stringMatching, anyEtag} = matchers;
|
||||
|
||||
describe('API Versioning', function () {
|
||||
describe('Admin API', function () {
|
||||
|
@ -29,7 +29,7 @@ describe('API Versioning', function () {
|
|||
}
|
||||
})
|
||||
.matchHeaderSnapshot({
|
||||
etag: anyString
|
||||
etag: anyEtag
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -44,7 +44,7 @@ describe('API Versioning', function () {
|
|||
}
|
||||
})
|
||||
.matchHeaderSnapshot({
|
||||
etag: anyString,
|
||||
etag: anyEtag,
|
||||
'content-version': stringMatching(/v\d+\.\d+/)
|
||||
});
|
||||
});
|
||||
|
@ -60,7 +60,7 @@ describe('API Versioning', function () {
|
|||
}
|
||||
})
|
||||
.matchHeaderSnapshot({
|
||||
etag: anyString,
|
||||
etag: anyEtag,
|
||||
'content-version': stringMatching(/v\d+\.\d+/)
|
||||
});
|
||||
});
|
||||
|
@ -72,7 +72,7 @@ describe('API Versioning', function () {
|
|||
.header('Accept-Version', 'v999.1')
|
||||
.expectStatus(406)
|
||||
.matchHeaderSnapshot({
|
||||
etag: anyString
|
||||
etag: anyEtag
|
||||
})
|
||||
.matchBodySnapshot({
|
||||
errors: [{
|
||||
|
@ -90,7 +90,7 @@ describe('API Versioning', function () {
|
|||
.header('User-Agent', 'Zapier 1.3')
|
||||
.expectStatus(406)
|
||||
.matchHeaderSnapshot({
|
||||
etag: anyString
|
||||
etag: anyEtag
|
||||
})
|
||||
.matchBodySnapshot({
|
||||
errors: [{
|
||||
|
@ -114,7 +114,7 @@ describe('API Versioning', function () {
|
|||
.header('User-Agent', 'Zapier 1.4')
|
||||
.expectStatus(406)
|
||||
.matchHeaderSnapshot({
|
||||
etag: anyString
|
||||
etag: anyEtag
|
||||
})
|
||||
.matchBodySnapshot({
|
||||
errors: [{
|
||||
|
@ -136,7 +136,7 @@ describe('API Versioning', function () {
|
|||
.header('User-Agent', 'Zapier 1.4')
|
||||
.expectStatus(406)
|
||||
.matchHeaderSnapshot({
|
||||
etag: anyString
|
||||
etag: anyEtag
|
||||
})
|
||||
.matchBodySnapshot({
|
||||
errors: [{
|
||||
|
@ -155,7 +155,7 @@ describe('API Versioning', function () {
|
|||
.header('Accept-Version', 'v4.1')
|
||||
.expectStatus(404)
|
||||
.matchHeaderSnapshot({
|
||||
etag: anyString
|
||||
etag: anyEtag
|
||||
})
|
||||
.matchBodySnapshot({
|
||||
errors: [{
|
||||
|
|
Loading…
Add table
Reference in a new issue