0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Merged v5.22.2 into main

v5.22.2
This commit is contained in:
Daniel Lockyer 2022-11-01 18:24:58 +07:00
commit 498bec08cf
No known key found for this signature in database
5 changed files with 27 additions and 2 deletions

View file

@ -1,6 +1,6 @@
{
"name": "ghost-admin",
"version": "5.22.1",
"version": "5.22.2",
"description": "Ember.js admin client for Ghost",
"author": "Ghost Foundation",
"homepage": "http://ghost.org",

View file

@ -1,6 +1,6 @@
{
"name": "ghost",
"version": "5.22.1",
"version": "5.22.2",
"description": "The professional publishing platform",
"author": "Ghost Foundation",
"homepage": "https://ghost.org",

View file

@ -126,4 +126,20 @@ describe('Tiers API', function () {
assert(updatedTier.trial_days === 0, `The trial_days should have been set to 0`);
});
it('Can edit description', async function () {
const {body: {tiers: [tier]}} = await agent.get('/tiers/?type:paid&limit=1');
await agent.put(`/tiers/${tier.id}/`)
.body({
tiers: [{
description: 'Updated description'
}]
})
.expectStatus(200);
const {body: {tiers: [updatedTier]}} = await agent.get(`/tiers/${tier.id}/`);
assert.strictEqual('Updated description', updatedTier.description);
});
});

View file

@ -338,6 +338,7 @@ function validateDescription(value) {
message: 'Tier description must be a string with a maximum of 191 characters'
});
}
return value;
}
function validateStatus(value) {

View file

@ -251,5 +251,13 @@ describe('Tier', function () {
});
});
});
it('Can set the description of a Tier', async function () {
const tier = await Tier.create(validInput);
tier.description = 'Updated description';
assert.strictEqual('Updated description', tier.description);
});
});
});