Ghost/test/unit
Kevin Ansfield 8d5e7ed695
🐛 Fixed unsubscribed members receiving email when a post is sent to all members (#13181)
refs https://github.com/TryGhost/Team/issues/935

The problem was incorrect operator precedence when multiple statements existed in the filter original filter when we transform it to enforce `subscribed:true` before sending.

- free only - subscribed:true+status:free - no issue
- paid only - subscribed:true+status:-free - no issue
- all - subscribed:true+status:-free,status:free - the ,status:free part is treated as a separate OR statement meaning the subscribed:true is not applied to it and free members that are unsubscribed will receive the email

- extracted the filter transform into a separate function so it can be unit tested
- updated the transform to use `()` for operator precedence, eg: `subscribed:true+(status:-free,status:free)`
- used transform function in `addEmail()` and `getEmailMemberRows()`
- fixed `sent/send` typo in error message
2021-07-26 12:47:03 +01:00
..
adapters Refactored scheduling default test to use nock 2021-07-15 14:07:11 +04:00
api Renamed tests to .test.js & updated commands 2021-07-06 20:45:01 +01:00
apps Renamed tests to .test.js & updated commands 2021-07-06 20:45:01 +01:00
data Removed use of deprecated new Error() syntax 2021-07-19 21:31:31 +12:00
helpers Moved labs utlity to shared 2021-07-08 09:05:41 +01:00
lib Fixed slow-running external request test 2021-07-15 15:21:33 +04:00
meta Renamed tests to .test.js & updated commands 2021-07-06 20:45:01 +01:00
models Reverted "Moved disguised unit tests into regression test suite" 2021-07-19 13:22:31 +04:00
server Renamed tests to .test.js & updated commands 2021-07-06 20:45:01 +01:00
services 🐛 Fixed unsubscribed members receiving email when a post is sent to all members (#13181) 2021-07-26 12:47:03 +01:00
shared Renamed tests to .test.js & updated commands 2021-07-06 20:45:01 +01:00
web Fixed error when requesting resize of a blank image 2021-07-07 19:11:24 +01:00