Skip to content

Commit

Permalink
Fixed cancel_link helper test
Browse files Browse the repository at this point in the history
no issue

- We don't check for specifics of the error thrown in the other heper tests, don't see a reason to do so here. It's important to see the error was thrown at all in this case
  • Loading branch information
naz committed Dec 20, 2019
1 parent 6896997 commit 7e44412
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions core/test/unit/helpers/cancel_link_spec.js
Expand Up @@ -18,15 +18,14 @@ describe('{{cancel_link}} helper', function () {
const defaultContinueLinkText = /Continue subscription/;

it('should throw if subscription data is incorrect', function () {
var runHelper = function (data) {
return function () {
helpers.cancel_link.call(data);
};
}, expectedMessage = 'The {{cancel_link}} helper was used outside of a subscription context. See https://ghost.org/docs/api/handlebars-themes/helpers/cancel_link/.';

runHelper('not an object').should.throwError(expectedMessage);
runHelper(function () {
}).should.throwError(expectedMessage);
const runHelper = function (data) {
return function () {
helpers.cancel_link.call(data);
};
};

runHelper('not an object').should.throw();
runHelper(function () {}).should.throw();
});

it('can render cancel subscription link', function () {
Expand Down

0 comments on commit 7e44412

Please sign in to comment.