mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-28 21:33:24 +03:00
Moved Ghost agent matcher to common framework
refsa499f866f3
refsd817e5830d
- The user-agent used in outgoing Ghost requests (webhooks mostly) is dependent on the Ghost version - snapshots break if the matcher is not dynamic. - There will be a few more webhooks tests coming soon, so makes sense to have this matcher moved to a common "framework matchers"
This commit is contained in:
parent
57f09fc8b7
commit
fe1d0e44b4
@ -1,5 +1,5 @@
|
||||
const {agentProvider, mockManager, fixtureManager, matchers} = require('../utils/e2e-framework');
|
||||
const {stringMatching, anyObjectId, anyISODateTime, anyUuid, anyContentVersion, anyNumber, anyLocalURL} = matchers;
|
||||
const {anyGhostAgent, anyObjectId, anyISODateTime, anyUuid, anyContentVersion, anyNumber, anyLocalURL} = matchers;
|
||||
|
||||
const tierSnapshot = {
|
||||
id: anyObjectId,
|
||||
@ -7,8 +7,6 @@ const tierSnapshot = {
|
||||
updated_at: anyISODateTime
|
||||
};
|
||||
|
||||
const anyGhostAgent = stringMatching(/Ghost\/\d+\.\d+\.\d+\s\(https:\/\/github.com\/TryGhost\/Ghost\)/);
|
||||
|
||||
const buildAuthorSnapshot = (roles = false) => {
|
||||
const authorSnapshot = {
|
||||
last_seen: anyISODateTime,
|
||||
|
@ -380,6 +380,7 @@ module.exports = {
|
||||
anyLocationFor: (resource) => {
|
||||
return stringMatching(new RegExp(`https?://.*?/${resource}/[a-f0-9]{24}/`));
|
||||
},
|
||||
anyGhostAgent: stringMatching(/Ghost\/\d+\.\d+\.\d+\s\(https:\/\/github.com\/TryGhost\/Ghost\)/),
|
||||
// @NOTE: hack here! it's due to https://github.com/TryGhost/Toolbox/issues/341
|
||||
// this matcher should be removed once the issue is solved - routing is redesigned
|
||||
// An ideal solution would be removal of this matcher altogether.
|
||||
|
Loading…
Reference in New Issue
Block a user