0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-25 02:31:59 -05:00
ghost/test
Simon Backx 5657019e47
Fixed wrong newsletter used when sending scheduled post (#14734)
refs https://ghost.slack.com/archives/C02G9E68C/p1651939076681719

Cause:
- When a scheduled post was published via the post scheduler, no `newsletter_id` option is passed when editing the post.
- When editing a post via the posts service, without the `newsletter_id` option, the `newsletter_id` option is automatically set to the default newsletter's id.
- Inside the post model, this new `newsletter_id` was not saved, because it was already set, and changing it is prevented.
- The `mega` service wasn't using the (unchanged) post's newsletter_id, but used the option instead, which contained the default newsletter's id.

Fix:
- Always using the newsletter_id from the post and requiring the newsletter associated with a post to exist.
- This behaviour can be/is tested by publishing a scheduled post without any option.

Also cleaned up some `Object.assign` usages.
2022-05-09 17:30:50 +02:00
..
e2e-api Fixed wrong newsletter used when sending scheduled post (#14734) 2022-05-09 17:30:50 +02:00
e2e-browser Added note about installing the E2E browsers 2022-02-22 10:20:40 +01:00
e2e-frontend Removed res.locals.apiVersion 2022-04-28 15:35:28 +01:00
e2e-server Added MRR stats service and endpoint (#14427) 2022-04-08 09:18:04 +02:00
integration Enabled Admin integration for newsletters API (#14714) 2022-05-09 20:46:34 +05:30
regression Added users.status validation to the schema 2022-05-09 16:13:44 +01:00
unit Enabled Admin integration for newsletters API (#14714) 2022-05-09 20:46:34 +05:30
utils Enabled Admin integration for newsletters API (#14714) 2022-05-09 20:46:34 +05:30
.eslintignore Updated casper test fixture to latest version 2022-01-25 14:10:53 +00:00
.eslintrc.js Upgraded no-skipped-test rule to error 2021-05-26 14:57:43 +01:00
.jshintrc Move tests from core to root (#11700) 2020-03-30 16:26:47 +01:00