0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00
ghost/test/unit
Fabien 'egg' O'Carroll 8f660c3259
Improved settings validation (#12048)
closes #12001

* Moved settings validation to the model

This moves the settings validation out of the validation file and into
the model, as it is _only_ used there.

It also sets us up in the future for custom validators on individual
settings.

* Improved validation of stripe_plans setting

- Checks `interval` is a valid string
- Checks `name` & `currency` are strings

* Moved stripe key validation into model

The stripe key settings are all nullable and the regex validation fails
when the input is `null`. Rather than reworking the entirety of how we
validate with default-settings validation objects, this moves the
validation into methods on the Settings model.

* Added tests for new setting validations

Adds tests for both valid and invalid settings, as well as helpers
making future tests easier and less repetitive
2020-07-15 17:11:27 +02:00
..
adapters Moved core/server/lib/url-utils to core/shared/url-utils (#11856) 2020-05-28 11:57:02 +01:00
api 🐛 Fixed facebook/twitter images having relative URLS in API output 2020-06-30 16:40:34 +01:00
apps 🐛 Fixed private blogging exposing 404 and robots (#11922) 2020-06-16 11:42:32 +01:00
data Improved settings validation (#12048) 2020-07-15 17:11:27 +02:00
helpers Updated tests that were stubbing old ghost_head/ghost_foot settings keys 2020-07-01 17:58:12 +01:00
lib 🐛 Fixed srcset and sizes attributes being rendered when image resizing unavailable 2020-07-02 18:03:22 +01:00
models Improved settings validation (#12048) 2020-07-15 17:11:27 +02:00
services 🐛 Fixed Stripe webhooks for subdirectory setups 2020-07-10 17:43:46 +02:00
shared/config Updated tests locations and added linting of core/shared (#11872) 2020-06-01 22:06:50 +01:00
web Moved core/server/lib/common/logging to core/shared/logging (#11857) 2020-05-28 19:30:23 +01:00