diff --git a/ghost/core/test/e2e-webhooks/__snapshots__/pages.test.js.snap b/ghost/core/test/e2e-webhooks/__snapshots__/pages.test.js.snap index 37757eeb82..bebbcb6b23 100644 --- a/ghost/core/test/e2e-webhooks/__snapshots__/pages.test.js.snap +++ b/ghost/core/test/e2e-webhooks/__snapshots__/pages.test.js.snap @@ -194,7 +194,7 @@ Object { "tour": null, "twitter": null, "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "url": "http://127.0.0.1:2369/author/joe-bloggs/", + "url": StringMatching /http:\\\\/\\\\/127\\.0\\.0\\.1:2369\\\\/\\\\w\\+\\\\//, "website": null, }, ], @@ -256,7 +256,7 @@ Object { "tour": null, "twitter": null, "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "url": "http://127.0.0.1:2369/author/joe-bloggs/", + "url": StringMatching /http:\\\\/\\\\/127\\.0\\.0\\.1:2369\\\\/\\\\w\\+\\\\//, "website": null, }, "primary_tag": null, @@ -627,7 +627,6 @@ Object { "count": Object { "paid_conversions": 0, "positive_feedback": 0, - "sentiment": 0, "signups": 0, }, "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, diff --git a/ghost/core/test/unit/frontend/helpers/helper-test-utils.js b/ghost/core/test/unit/frontend/helpers/helper-test-utils.js new file mode 100644 index 0000000000..9c44bc2bc1 --- /dev/null +++ b/ghost/core/test/unit/frontend/helpers/helper-test-utils.js @@ -0,0 +1,12 @@ +const handlebars = require('../../../../core/frontend/services/theme-engine/engine').handlebars; + +function shouldCompileToExpected(templateString, hash, expected) { + const template = handlebars.compile(templateString); + const result = template(hash); + + result.should.eql(expected); +} + +module.exports = { + shouldCompileToExpected +};