2016-10-12 17:18:57 +02:00
{
"models" : [
2021-04-20 16:39:27 +01:00
{
"name" : "Product" ,
"entries" : [
2022-01-11 19:24:51 +05:30
{
"name" : "Free" ,
"slug" : "free" ,
2022-01-20 15:50:18 +02:00
"type" : "free" ,
2022-03-01 18:11:59 +02:00
"active" : true ,
2022-03-04 11:07:38 +00:00
"visibility" : "public"
2022-01-11 19:24:51 +05:30
} ,
2021-04-20 16:39:27 +01:00
{
"name" : "Default Product" ,
2022-01-11 19:24:51 +05:30
"slug" : "default-product" ,
2022-01-20 15:50:18 +02:00
"type" : "paid" ,
2022-03-01 18:11:59 +02:00
"active" : true ,
2022-03-04 11:07:38 +00:00
"visibility" : "public"
2021-04-20 16:39:27 +01:00
}
]
} ,
2022-04-12 19:44:21 +05:30
{
"name" : "Newsletter" ,
"entries" : [
{
"name" : "Default Newsletter" ,
2022-04-21 16:14:16 +01:00
"slug" : "default-newsletter" ,
"show_header_name" : false
2022-04-12 19:44:21 +05:30
}
]
} ,
2016-10-12 17:18:57 +02:00
{
"name" : "Tag" ,
"entries" : [
{
2022-03-10 17:41:46 +00:00
"name" : "News" ,
"slug" : "news" ,
2016-10-12 17:18:57 +02:00
"description" : null ,
"parent_id" : null ,
"meta_title" : null ,
"meta_description" : null
}
]
} ,
{
"name" : "Role" ,
"entries" : [
{
2018-10-02 17:46:38 +01:00
"name" : "Administrator" ,
"description" : "Administrators"
2016-10-12 17:18:57 +02:00
} ,
{
2018-10-02 17:46:38 +01:00
"name" : "Editor" ,
"description" : "Editors"
2016-10-12 17:18:57 +02:00
} ,
{
2018-10-02 17:46:38 +01:00
"name" : "Author" ,
"description" : "Authors"
2016-10-12 17:18:57 +02:00
} ,
2018-02-07 10:46:22 +01:00
{
2018-10-02 17:46:38 +01:00
"name" : "Contributor" ,
"description" : "Contributors"
2018-02-07 10:46:22 +01:00
} ,
2016-10-12 17:18:57 +02:00
{
2018-10-02 17:46:38 +01:00
"name" : "Owner" ,
"description" : "Blog Owner"
} ,
{
"name" : "Admin Integration" ,
"description" : "External Apps"
2019-08-02 17:28:02 +08:00
} ,
{
"name" : "DB Backup Integration" ,
"description" : "Internal DB Backup Client"
2019-07-31 22:34:49 +02:00
} ,
{
"name" : "Scheduler Integration" ,
"description" : "Internal Scheduler Client"
2016-10-12 17:18:57 +02:00
}
]
} ,
{
"name" : "Permission" ,
"entries" : [
{
"name" : "Export database" ,
"action_type" : "exportContent" ,
"object_type" : "db"
} ,
{
"name" : "Import database" ,
"action_type" : "importContent" ,
"object_type" : "db"
} ,
{
"name" : "Delete all content" ,
"action_type" : "deleteAllContent" ,
"object_type" : "db"
} ,
{
"name" : "Send mail" ,
"action_type" : "send" ,
"object_type" : "mail"
} ,
{
"name" : "Browse notifications" ,
"action_type" : "browse" ,
"object_type" : "notification"
} ,
{
"name" : "Add notifications" ,
"action_type" : "add" ,
"object_type" : "notification"
} ,
{
"name" : "Delete notifications" ,
"action_type" : "destroy" ,
"object_type" : "notification"
} ,
{
"name" : "Browse posts" ,
"action_type" : "browse" ,
"object_type" : "post"
} ,
{
"name" : "Read posts" ,
"action_type" : "read" ,
"object_type" : "post"
} ,
{
"name" : "Edit posts" ,
"action_type" : "edit" ,
"object_type" : "post"
} ,
{
"name" : "Add posts" ,
"action_type" : "add" ,
"object_type" : "post"
} ,
{
"name" : "Delete posts" ,
"action_type" : "destroy" ,
"object_type" : "post"
} ,
{
"name" : "Browse settings" ,
"action_type" : "browse" ,
"object_type" : "setting"
} ,
{
"name" : "Read settings" ,
"action_type" : "read" ,
"object_type" : "setting"
} ,
{
"name" : "Edit settings" ,
"action_type" : "edit" ,
"object_type" : "setting"
} ,
{
"name" : "Generate slugs" ,
"action_type" : "generate" ,
"object_type" : "slug"
} ,
{
"name" : "Browse tags" ,
"action_type" : "browse" ,
"object_type" : "tag"
} ,
{
"name" : "Read tags" ,
"action_type" : "read" ,
"object_type" : "tag"
} ,
{
"name" : "Edit tags" ,
"action_type" : "edit" ,
"object_type" : "tag"
} ,
{
"name" : "Add tags" ,
"action_type" : "add" ,
"object_type" : "tag"
} ,
{
"name" : "Delete tags" ,
"action_type" : "destroy" ,
"object_type" : "tag"
} ,
{
"name" : "Browse themes" ,
"action_type" : "browse" ,
"object_type" : "theme"
} ,
{
"name" : "Edit themes" ,
"action_type" : "edit" ,
"object_type" : "theme"
} ,
2017-03-13 11:44:44 +00:00
{
"name" : "Activate themes" ,
"action_type" : "activate" ,
"object_type" : "theme"
} ,
2016-10-12 17:18:57 +02:00
{
"name" : "Upload themes" ,
"action_type" : "add" ,
"object_type" : "theme"
} ,
{
"name" : "Download themes" ,
"action_type" : "read" ,
"object_type" : "theme"
} ,
{
"name" : "Delete themes" ,
"action_type" : "destroy" ,
"object_type" : "theme"
} ,
{
"name" : "Browse users" ,
"action_type" : "browse" ,
"object_type" : "user"
} ,
{
"name" : "Read users" ,
"action_type" : "read" ,
"object_type" : "user"
} ,
{
"name" : "Edit users" ,
"action_type" : "edit" ,
"object_type" : "user"
} ,
{
"name" : "Add users" ,
"action_type" : "add" ,
"object_type" : "user"
} ,
{
"name" : "Delete users" ,
"action_type" : "destroy" ,
"object_type" : "user"
} ,
{
"name" : "Assign a role" ,
"action_type" : "assign" ,
"object_type" : "role"
} ,
{
"name" : "Browse roles" ,
"action_type" : "browse" ,
"object_type" : "role"
} ,
{
"name" : "Browse invites" ,
"action_type" : "browse" ,
"object_type" : "invite"
} ,
{
"name" : "Read invites" ,
"action_type" : "read" ,
"object_type" : "invite"
} ,
{
2017-03-13 11:44:44 +00:00
"name" : "Edit invites" ,
"action_type" : "edit" ,
2016-10-12 17:18:57 +02:00
"object_type" : "invite"
} ,
{
2017-03-13 11:44:44 +00:00
"name" : "Add invites" ,
"action_type" : "add" ,
2016-10-12 17:18:57 +02:00
"object_type" : "invite"
} ,
{
"name" : "Delete invites" ,
"action_type" : "destroy" ,
"object_type" : "invite"
2017-09-21 17:01:03 +02:00
} ,
{
"name" : "Download redirects" ,
"action_type" : "download" ,
"object_type" : "redirect"
} ,
{
"name" : "Upload redirects" ,
"action_type" : "upload" ,
"object_type" : "redirect"
2017-11-21 15:43:14 +00:00
} ,
{
"name" : "Add webhooks" ,
"action_type" : "add" ,
"object_type" : "webhook"
2018-10-19 18:35:55 +01:00
} ,
{
"name" : "Edit webhooks" ,
"action_type" : "edit" ,
"object_type" : "webhook"
2017-11-21 15:43:14 +00:00
} ,
{
"name" : "Delete webhooks" ,
"action_type" : "destroy" ,
"object_type" : "webhook"
2018-10-02 17:46:38 +01:00
} ,
{
"name" : "Browse integrations" ,
"action_type" : "browse" ,
"object_type" : "integration"
} ,
{
"name" : "Read integrations" ,
"action_type" : "read" ,
"object_type" : "integration"
} ,
{
"name" : "Edit integrations" ,
"action_type" : "edit" ,
"object_type" : "integration"
} ,
{
"name" : "Add integrations" ,
"action_type" : "add" ,
"object_type" : "integration"
} ,
{
"name" : "Delete integrations" ,
"action_type" : "destroy" ,
"object_type" : "integration"
} ,
{
"name" : "Browse API keys" ,
"action_type" : "browse" ,
"object_type" : "api_key"
} ,
{
"name" : "Read API keys" ,
"action_type" : "read" ,
"object_type" : "api_key"
} ,
{
"name" : "Edit API keys" ,
"action_type" : "edit" ,
"object_type" : "api_key"
} ,
{
"name" : "Add API keys" ,
"action_type" : "add" ,
"object_type" : "api_key"
} ,
{
"name" : "Delete API keys" ,
"action_type" : "destroy" ,
"object_type" : "api_key"
2019-01-29 19:00:44 +01:00
} ,
{
"name" : "Browse Actions" ,
"action_type" : "browse" ,
"object_type" : "action"
2019-02-26 10:24:09 +07:00
} ,
{
"name" : "Browse Members" ,
"action_type" : "browse" ,
"object_type" : "member"
} ,
{
"name" : "Read Members" ,
"action_type" : "read" ,
"object_type" : "member"
} ,
{
"name" : "Edit Members" ,
"action_type" : "edit" ,
"object_type" : "member"
} ,
{
"name" : "Add Members" ,
"action_type" : "add" ,
"object_type" : "member"
} ,
{
"name" : "Delete Members" ,
"action_type" : "destroy" ,
"object_type" : "member"
2019-08-06 14:56:47 +02:00
} ,
2021-04-15 14:34:45 +01:00
{
"name" : "Browse Products" ,
"action_type" : "browse" ,
"object_type" : "product"
} ,
{
"name" : "Read Products" ,
"action_type" : "read" ,
"object_type" : "product"
} ,
{
"name" : "Edit Products" ,
"action_type" : "edit" ,
"object_type" : "product"
} ,
{
"name" : "Add Products" ,
"action_type" : "add" ,
"object_type" : "product"
} ,
{
"name" : "Delete Products" ,
"action_type" : "destroy" ,
"object_type" : "product"
} ,
2019-08-06 14:56:47 +02:00
{
"name" : "Publish posts" ,
"action_type" : "publish" ,
"object_type" : "post"
2019-08-09 00:53:59 +02:00
} ,
{
"name" : "Backup database" ,
"action_type" : "backupContent" ,
"object_type" : "db"
2019-11-05 11:32:13 +07:00
} ,
{
"name" : "Email preview" ,
"action_type" : "read" ,
"object_type" : "email_preview"
2019-11-06 15:21:13 +07:00
} ,
{
"name" : "Send test email" ,
"action_type" : "sendTestEmail" ,
"object_type" : "email_preview"
2019-11-06 14:55:53 +07:00
} ,
{
2019-11-22 14:20:32 +00:00
"name" : "Browse emails" ,
"action_type" : "browse" ,
"object_type" : "email"
} ,
{
"name" : "Read emails" ,
2019-11-06 14:55:53 +07:00
"action_type" : "read" ,
"object_type" : "email"
2019-11-22 14:20:32 +00:00
} ,
{
"name" : "Retry emails" ,
"action_type" : "retry" ,
"object_type" : "email"
2020-02-14 15:44:47 +05:30
} ,
{
"name" : "Browse labels" ,
"action_type" : "browse" ,
"object_type" : "label"
} ,
{
"name" : "Read labels" ,
"action_type" : "read" ,
"object_type" : "label"
} ,
{
"name" : "Edit labels" ,
"action_type" : "edit" ,
"object_type" : "label"
} ,
{
"name" : "Add labels" ,
"action_type" : "add" ,
"object_type" : "label"
} ,
{
"name" : "Delete labels" ,
"action_type" : "destroy" ,
"object_type" : "label"
2020-02-27 11:48:02 +08:00
} ,
{
"name" : "Read member signin urls" ,
"action_type" : "read" ,
"object_type" : "member_signin_url"
2020-01-20 13:45:58 +02:00
} ,
{
"name" : "Read identities" ,
"action_type" : "read" ,
"object_type" : "identity"
2020-06-01 12:27:14 +02:00
} ,
{
"name" : "Auth Stripe Connect for Members" ,
"action_type" : "auth" ,
"object_type" : "members_stripe_connect"
2020-10-16 12:53:09 +01:00
} ,
{
"name" : "Browse snippets" ,
"action_type" : "browse" ,
"object_type" : "snippet"
} ,
{
"name" : "Read snippets" ,
"action_type" : "read" ,
"object_type" : "snippet"
} ,
{
"name" : "Edit snippets" ,
"action_type" : "edit" ,
"object_type" : "snippet"
} ,
{
"name" : "Add snippets" ,
"action_type" : "add" ,
"object_type" : "snippet"
} ,
{
"name" : "Delete snippets" ,
2020-10-16 17:46:31 +01:00
"action_type" : "destroy" ,
2020-10-16 12:53:09 +01:00
"object_type" : "snippet"
2021-06-23 14:54:28 +02:00
} ,
2021-10-01 15:48:33 +05:30
{
"name" : "Browse offers" ,
"action_type" : "browse" ,
"object_type" : "offer"
} ,
{
"name" : "Read offers" ,
"action_type" : "read" ,
"object_type" : "offer"
} ,
{
"name" : "Edit offers" ,
"action_type" : "edit" ,
"object_type" : "offer"
} ,
{
"name" : "Add offers" ,
"action_type" : "add" ,
"object_type" : "offer"
} ,
2021-06-23 14:54:28 +02:00
{
"name" : "Reset all passwords" ,
"action_type" : "resetAllPasswords" ,
"object_type" : "authentication"
2021-09-27 09:59:09 +01:00
} ,
{
"name" : "Browse custom theme settings" ,
"action_type" : "browse" ,
"object_type" : "custom_theme_setting"
} ,
{
"name" : "Edit custom theme settings" ,
"action_type" : "edit" ,
"object_type" : "custom_theme_setting"
2022-04-13 12:02:06 +02:00
} ,
{
"name" : "Browse newsletters" ,
"action_type" : "browse" ,
"object_type" : "newsletter"
} ,
2022-04-20 15:25:41 +02:00
{
"name" : "Read newsletters" ,
"action_type" : "read" ,
"object_type" : "newsletter"
} ,
2022-04-13 12:02:06 +02:00
{
"name" : "Add newsletters" ,
"action_type" : "add" ,
"object_type" : "newsletter"
} ,
{
"name" : "Edit newsletters" ,
"action_type" : "edit" ,
"object_type" : "newsletter"
2016-10-12 17:18:57 +02:00
}
]
} ,
{
"name" : "User" ,
"entries" : [
{
✨ replace auto increment id's by object id (#7495)
* 🛠 bookshelf tarball, bson-objectid
* 🎨 schema changes
- change increment type to string
- add a default fallback for string length 191 (to avoid adding this logic to every single column which uses an ID)
- remove uuid, because ID now represents a global resource identifier
- keep uuid for post, because we are using this as preview id
- keep uuid for clients for now - we are using this param for Ghost-Auth
* ✨ base model: generate ObjectId on creating event
- each new resource get's a auto generate ObjectId
- this logic won't work for attached models, this commit comes later
* 🎨 centralised attach method
When attaching models there are two things important two know
1. To be able to attach an ObjectId, we need to register the `onCreating` event the fetched model!This is caused by the Bookshelf design in general. On this target model we are attaching the new model.
2. We need to manually fetch the target model, because Bookshelf has a weird behaviour (which is known as a bug, see see https://github.com/tgriesser/bookshelf/issues/629). The most important property when attaching a model is `parentFk`, which is the foreign key. This can be null when fetching the model with the option `withRelated`. To ensure quality and consistency, the custom attach wrapper always fetches the target model manual. By fetching the target model (again) is a little performance decrease, but it also has advantages: we can register the event, and directly unregister the event again. So very clean code.
Important: please only use the custom attach wrapper in the future.
* 🎨 token model had overriden the onCreating function because of the created_at field
- we need to ensure that the base onCreating hook get's triggered for ALL models
- if not, they don't get an ObjectId assigned
- in this case: be smart and check if the target model has a created_at field
* 🎨 we don't have a uuid field anymore, remove the usages
- no default uuid creation in models
- i am pretty sure we have some more definitions in our tests (for example in the export json files), but that is too much work to delete them all
* 🎨 do not parse ID to Number
- we had various occurances of parsing all ID's to numbers
- we don't need this behaviour anymore
- ID is string
- i will adapt the ID validation in the next commit
* 🎨 change ID regex for validation
- we only allow: ID as ObjectId, ID as 1 and ID as me
- we need to keep ID 1, because our whole software relies on ID 1 (permissions etc)
* 🎨 owner fixture
- roles: [4] does not work anymore
- 4 means -> static id 4
- this worked in an auto increment system (not even in a system with distributed writes)
- with ObjectId we generate each ID automatically (for static and dynamic resources)
- it is possible to define all id's for static resources still, but that means we need to know which ID is already used and for consistency we have to define ObjectId's for these static resources
- so no static id's anymore, except of: id 1 for owner and id 0 for external usage (because this is required from our permission system)
- NOTE: please read through the comment in the user model
* 🎨 tests: DataGenerator and test utils
First of all: we need to ensure using ObjectId's in the tests. When don't, we can't ensure that ObjectId's work properly.
This commit brings lot's of dynamic into all the static defined id's.
In one of the next commits, i will adapt all the tests.
* 🚨 remove counter in Notification API
- no need to add a counter
- we simply generate ObjectId's (they are auto incremental as well)
- our id validator does only allow ObjectId as id,1 and me
* 🎨 extend contextUser in Base Model
- remove isNumber check, because id's are no longer numbers, except of id 0/1
- use existing isExternalUser
- support id 0/1 as string or number
* ✨ Ghost Owner has id 1
- ensure we define this id in the fixtures.json
- doesn't matter if number or string
* 🎨 functional tests adaptions
- use dynamic id's
* 🎨 fix unit tests
* 🎨 integration tests adaptions
* 🎨 change importer utils
- all our export examples (test/fixtures/exports) contain id's as numbers
- fact: but we ignore them anyway when inserting into the database, see https://github.com/TryGhost/Ghost/blob/master/core/server/data/import/utils.js#L249
- in https://github.com/TryGhost/Ghost/pull/7495/commits/0e6ed957cd54dc02a25cf6fb1ab7d7e723295e2c#diff-70f514a06347c048648be464819503c4L67 i removed parsing id's to integers
- i realised that this ^ check just existed, because the userIdToMap was an object key and object keys are always strings!
- i think this logic is a little bit complicated, but i don't want to refactor this now
- this commit ensures when trying to find the user, the id comparison works again
- i've added more documentation to understand this logic ;)
- plus i renamed an attribute to improve readability
* 🎨 Data-Generator: add more defaults to createUser
- if i use the function DataGenerator.forKnex.createUser i would like to get a full set of defaults
* 🎨 test utils: change/extend function set for functional tests
- functional tests work a bit different
- they boot Ghost and seed the database
- some functional tests have mis-used the test setup
- the test setup needs two sections: integration/unit and functional tests
- any functional test is allowed to either add more data or change data in the existing Ghost db
- but what it should not do is: add test fixtures like roles or users from our DataGenerator and cross fingers it will work
- this commit adds a clean method for functional tests to add extra users
* 🎨 functional tests adaptions
- use last commit to insert users for functional tests clean
- tidy up usage of testUtils.setup or testUtils.doAuth
* 🐛 test utils: reset database before init
- ensure we don't have any left data from other tests in the database when starting ghost
* 🐛 fix test (unrelated to this PR)
- fixes a random failure
- return statement was missing
* 🎨 make changes for invites
2016-11-17 10:09:11 +01:00
"id" : 1 ,
2017-05-29 18:25:19 +01:00
"name" : "Ghost" ,
"email" : "ghost@example.com" ,
2016-10-12 17:18:57 +02:00
"status" : "inactive" ,
✨ replace auto increment id's by object id (#7495)
* 🛠 bookshelf tarball, bson-objectid
* 🎨 schema changes
- change increment type to string
- add a default fallback for string length 191 (to avoid adding this logic to every single column which uses an ID)
- remove uuid, because ID now represents a global resource identifier
- keep uuid for post, because we are using this as preview id
- keep uuid for clients for now - we are using this param for Ghost-Auth
* ✨ base model: generate ObjectId on creating event
- each new resource get's a auto generate ObjectId
- this logic won't work for attached models, this commit comes later
* 🎨 centralised attach method
When attaching models there are two things important two know
1. To be able to attach an ObjectId, we need to register the `onCreating` event the fetched model!This is caused by the Bookshelf design in general. On this target model we are attaching the new model.
2. We need to manually fetch the target model, because Bookshelf has a weird behaviour (which is known as a bug, see see https://github.com/tgriesser/bookshelf/issues/629). The most important property when attaching a model is `parentFk`, which is the foreign key. This can be null when fetching the model with the option `withRelated`. To ensure quality and consistency, the custom attach wrapper always fetches the target model manual. By fetching the target model (again) is a little performance decrease, but it also has advantages: we can register the event, and directly unregister the event again. So very clean code.
Important: please only use the custom attach wrapper in the future.
* 🎨 token model had overriden the onCreating function because of the created_at field
- we need to ensure that the base onCreating hook get's triggered for ALL models
- if not, they don't get an ObjectId assigned
- in this case: be smart and check if the target model has a created_at field
* 🎨 we don't have a uuid field anymore, remove the usages
- no default uuid creation in models
- i am pretty sure we have some more definitions in our tests (for example in the export json files), but that is too much work to delete them all
* 🎨 do not parse ID to Number
- we had various occurances of parsing all ID's to numbers
- we don't need this behaviour anymore
- ID is string
- i will adapt the ID validation in the next commit
* 🎨 change ID regex for validation
- we only allow: ID as ObjectId, ID as 1 and ID as me
- we need to keep ID 1, because our whole software relies on ID 1 (permissions etc)
* 🎨 owner fixture
- roles: [4] does not work anymore
- 4 means -> static id 4
- this worked in an auto increment system (not even in a system with distributed writes)
- with ObjectId we generate each ID automatically (for static and dynamic resources)
- it is possible to define all id's for static resources still, but that means we need to know which ID is already used and for consistency we have to define ObjectId's for these static resources
- so no static id's anymore, except of: id 1 for owner and id 0 for external usage (because this is required from our permission system)
- NOTE: please read through the comment in the user model
* 🎨 tests: DataGenerator and test utils
First of all: we need to ensure using ObjectId's in the tests. When don't, we can't ensure that ObjectId's work properly.
This commit brings lot's of dynamic into all the static defined id's.
In one of the next commits, i will adapt all the tests.
* 🚨 remove counter in Notification API
- no need to add a counter
- we simply generate ObjectId's (they are auto incremental as well)
- our id validator does only allow ObjectId as id,1 and me
* 🎨 extend contextUser in Base Model
- remove isNumber check, because id's are no longer numbers, except of id 0/1
- use existing isExternalUser
- support id 0/1 as string or number
* ✨ Ghost Owner has id 1
- ensure we define this id in the fixtures.json
- doesn't matter if number or string
* 🎨 functional tests adaptions
- use dynamic id's
* 🎨 fix unit tests
* 🎨 integration tests adaptions
* 🎨 change importer utils
- all our export examples (test/fixtures/exports) contain id's as numbers
- fact: but we ignore them anyway when inserting into the database, see https://github.com/TryGhost/Ghost/blob/master/core/server/data/import/utils.js#L249
- in https://github.com/TryGhost/Ghost/pull/7495/commits/0e6ed957cd54dc02a25cf6fb1ab7d7e723295e2c#diff-70f514a06347c048648be464819503c4L67 i removed parsing id's to integers
- i realised that this ^ check just existed, because the userIdToMap was an object key and object keys are always strings!
- i think this logic is a little bit complicated, but i don't want to refactor this now
- this commit ensures when trying to find the user, the id comparison works again
- i've added more documentation to understand this logic ;)
- plus i renamed an attribute to improve readability
* 🎨 Data-Generator: add more defaults to createUser
- if i use the function DataGenerator.forKnex.createUser i would like to get a full set of defaults
* 🎨 test utils: change/extend function set for functional tests
- functional tests work a bit different
- they boot Ghost and seed the database
- some functional tests have mis-used the test setup
- the test setup needs two sections: integration/unit and functional tests
- any functional test is allowed to either add more data or change data in the existing Ghost db
- but what it should not do is: add test fixtures like roles or users from our DataGenerator and cross fingers it will work
- this commit adds a clean method for functional tests to add extra users
* 🎨 functional tests adaptions
- use last commit to insert users for functional tests clean
- tidy up usage of testUtils.setup or testUtils.doAuth
* 🐛 test utils: reset database before init
- ensure we don't have any left data from other tests in the database when starting ghost
* 🐛 fix test (unrelated to this PR)
- fixes a random failure
- return statement was missing
* 🎨 make changes for invites
2016-11-17 10:09:11 +01:00
"roles" : [ ]
2016-10-12 17:18:57 +02:00
}
]
2018-03-27 16:16:15 +02:00
} ,
{
"name" : "Post" ,
"entries" : [
{
2022-03-10 17:41:46 +00:00
"title" : "Coming soon" ,
"slug" : "coming-soon" ,
"feature_image" : "https://static.ghost.org/v4.0.0/images/feature-image.jpg" ,
"mobiledoc" : "{\"version\":\"0.3.1\",\"atoms\":[],\"cards\":[],\"markups\":[[\"a\",[\"href\",\"#/portal/\",\"rel\",\"noopener noreferrer\"]]],\"sections\":[[1,\"p\",[[0,[],0,\"This is a brand new site that's just getting started. Things will be up and running here shortly, but you can \"],[0,[0],1,\"subscribe\"],[0,[],0,\" in the meantime if you'd like to stay up to date and receive emails when new content is published!\"]]]],\"ghostVersion\":\"4.0\"}" ,
2018-03-27 16:16:15 +02:00
"featured" : false ,
2019-09-16 11:51:54 +01:00
"type" : "post" ,
2018-03-27 16:16:15 +02:00
"status" : "published" ,
2021-03-10 14:19:11 +00:00
"visibility" : "public" ,
2022-03-10 17:41:46 +00:00
"created_by" : "1" ,
"published_by" : "1" ,
"author_id" : "1"
2021-03-10 14:19:11 +00:00
} ,
{
"title" : "About this site" ,
"slug" : "about" ,
2022-03-10 17:41:46 +00:00
"mobiledoc" : "{\"version\":\"0.3.1\",\"atoms\":[],\"cards\":[[\"hr\",{}]],\"markups\":[[\"a\",[\"href\",\"https://ghost.org\"]]],\"sections\":[[1,\"p\",[[0,[],0,\"This is an independent publication. If you subscribe today, you'll get full access to the website as well as email newsletters about new content when it's available. Your subscription makes this site possible. Thank you!\"]]],[1,\"h3\",[[0,[],0,\"Access all areas\"]]],[1,\"p\",[[0,[],0,\"By signing up, you'll get access to the full archive of everything that's been published before and everything that's still to come. Your very own private library.\"]]],[1,\"h3\",[[0,[],0,\"Fresh content, delivered\"]]],[1,\"p\",[[0,[],0,\"Stay up to date with new content sent straight to your inbox! No more worrying about whether you missed something because of a pesky algorithm or news feed.\"]]],[1,\"h3\",[[0,[],0,\"Meet people like you\"]]],[1,\"p\",[[0,[],0,\"Join a community of other subscribers who share the same interests.\"]]],[10,0],[1,\"h3\",[[0,[],0,\"Start your own thing\"]]],[1,\"p\",[[0,[],0,\"Enjoying the experience? Get started for free and set up your very own subscription business using \"],[0,[0],1,\"Ghost\"],[0,[],0,\", the same platform that powers this website.\"]]]],\"ghostVersion\":\"4.0\"}" ,
2021-03-10 14:19:11 +00:00
"featured" : false ,
"type" : "page" ,
"status" : "published" ,
"visibility" : "public" ,
2022-03-10 17:41:46 +00:00
"created_by" : "1" ,
"published_by" : "1" ,
"author_id" : "1"
2018-03-27 16:16:15 +02:00
}
]
2019-02-15 14:48:21 +00:00
} ,
{
"name" : "Integration" ,
"entries" : [
{
"slug" : "zapier" ,
"name" : "Zapier" ,
"description" : "Built-in Zapier integration" ,
"type" : "builtin" ,
"api_keys" : [ { "type" : "admin" } ]
2019-08-02 17:28:02 +08:00
} ,
{
"slug" : "ghost-backup" ,
"name" : "Ghost Backup" ,
"description" : "Internal DB Backup integration" ,
"type" : "internal" ,
"api_keys" : [ { "type" : "admin" , "role" : "DB Backup Integration" } ]
2019-07-31 22:34:49 +02:00
} ,
{
"slug" : "ghost-scheduler" ,
"name" : "Ghost Scheduler" ,
"description" : "Internal Scheduler integration" ,
"type" : "internal" ,
"api_keys" : [ { "type" : "admin" , "role" : "Scheduler Integration" } ]
2019-02-15 14:48:21 +00:00
}
]
2016-10-12 17:18:57 +02:00
}
] ,
"relations" : [
{
"from" : {
"model" : "Role" ,
"match" : "name" ,
"relation" : "permissions"
} ,
"to" : {
"model" : "Permission" ,
"match" : [ "object_type" , "action_type" ]
} ,
"entries" : {
"Administrator" : {
"db" : "all" ,
2018-10-02 17:46:38 +01:00
"mail" : "all" ,
"notification" : "all" ,
"post" : "all" ,
"setting" : "all" ,
"slug" : "all" ,
"tag" : "all" ,
"theme" : "all" ,
"user" : "all" ,
"role" : "all" ,
"invite" : "all" ,
"redirect" : "all" ,
"webhook" : "all" ,
"integration" : "all" ,
2019-01-29 19:00:44 +01:00
"api_key" : "all" ,
2019-02-26 10:24:09 +07:00
"action" : "all" ,
2019-11-05 11:32:13 +07:00
"member" : "all" ,
2021-04-15 14:34:45 +01:00
"product" : "all" ,
2020-02-14 15:03:10 +05:30
"label" : "all" ,
2019-11-06 14:55:53 +07:00
"email_preview" : "all" ,
2020-08-18 14:17:56 +05:30
"email" : "all" ,
2020-10-16 12:53:09 +01:00
"member_signin_url" : "read" ,
2021-06-23 14:54:28 +02:00
"snippet" : "all" ,
2021-09-27 09:59:09 +01:00
"custom_theme_setting" : "all" ,
2021-10-01 15:48:33 +05:30
"offer" : "all" ,
2021-08-26 12:00:40 +02:00
"authentication" : "resetAllPasswords" ,
2022-04-13 12:02:06 +02:00
"members_stripe_connect" : "auth" ,
"newsletter" : "all"
2019-08-02 17:28:02 +08:00
} ,
"DB Backup Integration" : {
"db" : "all"
2019-07-31 22:34:49 +02:00
} ,
"Scheduler Integration" : {
"post" : "publish"
2018-10-02 17:46:38 +01:00
} ,
"Admin Integration" : {
2016-10-12 17:18:57 +02:00
"mail" : "all" ,
"notification" : "all" ,
"post" : "all" ,
"setting" : "all" ,
"slug" : "all" ,
"tag" : "all" ,
"theme" : "all" ,
"user" : "all" ,
"role" : "all" ,
2017-09-21 17:01:03 +02:00
"invite" : "all" ,
2017-11-21 15:43:14 +00:00
"redirect" : "all" ,
2019-01-29 19:00:44 +01:00
"webhook" : "all" ,
2019-02-26 10:24:09 +07:00
"action" : "all" ,
2019-11-05 11:32:13 +07:00
"member" : "all" ,
2020-02-14 15:03:10 +05:30
"label" : "all" ,
2019-11-06 14:55:53 +07:00
"email_preview" : "all" ,
2020-10-16 12:53:09 +01:00
"email" : "all" ,
2022-03-16 16:46:26 +05:30
"snippet" : "all" ,
"product" : [ "browse" , "read" , "add" , "edit" ] ,
"offer" : [ "browse" , "read" , "add" , "edit" ]
2016-10-12 17:18:57 +02:00
} ,
"Editor" : {
2019-04-17 19:18:44 +02:00
"notification" : "all" ,
2016-10-12 17:18:57 +02:00
"post" : "all" ,
"setting" : [ "browse" , "read" ] ,
"slug" : "all" ,
"tag" : "all" ,
"user" : "all" ,
"role" : "all" ,
2017-10-10 14:36:35 +02:00
"invite" : "all" ,
2019-11-05 11:32:13 +07:00
"theme" : [ "browse" ] ,
2019-11-06 14:55:53 +07:00
"email_preview" : "all" ,
2020-10-16 12:53:09 +01:00
"email" : "all" ,
2021-04-15 14:34:45 +01:00
"snippet" : "all" ,
2021-05-07 10:51:44 +01:00
"label" : [ "browse" , "read" ] ,
2021-04-15 14:34:45 +01:00
"product" : [ "browse" , "read" ]
2016-10-12 17:18:57 +02:00
} ,
"Author" : {
"post" : [ "browse" , "read" , "add" ] ,
"setting" : [ "browse" , "read" ] ,
"slug" : "all" ,
"tag" : [ "browse" , "read" , "add" ] ,
"user" : [ "browse" , "read" ] ,
"role" : [ "browse" ] ,
2019-11-05 11:32:13 +07:00
"theme" : [ "browse" ] ,
2019-11-06 14:55:53 +07:00
"email_preview" : "read" ,
2020-10-16 12:53:09 +01:00
"email" : "read" ,
2021-04-15 14:34:45 +01:00
"snippet" : [ "browse" , "read" ] ,
"product" : [ "browse" , "read" ]
2018-02-07 10:46:22 +01:00
} ,
"Contributor" : {
"post" : [ "browse" , "read" , "add" ] ,
"setting" : [ "browse" , "read" ] ,
"slug" : "all" ,
"tag" : [ "browse" , "read" ] ,
"user" : [ "browse" , "read" ] ,
"role" : [ "browse" ] ,
2019-11-05 11:32:13 +07:00
"theme" : [ "browse" ] ,
2019-11-06 14:55:53 +07:00
"email_preview" : "read" ,
2020-10-16 12:53:09 +01:00
"email" : "read" ,
"snippet" : [ "browse" , "read" ]
2016-10-12 17:18:57 +02:00
}
}
} ,
{
"from" : {
"model" : "Post" ,
2018-08-10 13:55:03 +02:00
"match" : "slug" ,
2016-10-12 17:18:57 +02:00
"relation" : "tags"
} ,
"to" : {
"model" : "Tag" ,
"match" : "name"
} ,
"entries" : {
2022-03-10 17:41:46 +00:00
"coming-soon" : [ "News" ]
2016-10-12 17:18:57 +02:00
}
✨ replace auto increment id's by object id (#7495)
* 🛠 bookshelf tarball, bson-objectid
* 🎨 schema changes
- change increment type to string
- add a default fallback for string length 191 (to avoid adding this logic to every single column which uses an ID)
- remove uuid, because ID now represents a global resource identifier
- keep uuid for post, because we are using this as preview id
- keep uuid for clients for now - we are using this param for Ghost-Auth
* ✨ base model: generate ObjectId on creating event
- each new resource get's a auto generate ObjectId
- this logic won't work for attached models, this commit comes later
* 🎨 centralised attach method
When attaching models there are two things important two know
1. To be able to attach an ObjectId, we need to register the `onCreating` event the fetched model!This is caused by the Bookshelf design in general. On this target model we are attaching the new model.
2. We need to manually fetch the target model, because Bookshelf has a weird behaviour (which is known as a bug, see see https://github.com/tgriesser/bookshelf/issues/629). The most important property when attaching a model is `parentFk`, which is the foreign key. This can be null when fetching the model with the option `withRelated`. To ensure quality and consistency, the custom attach wrapper always fetches the target model manual. By fetching the target model (again) is a little performance decrease, but it also has advantages: we can register the event, and directly unregister the event again. So very clean code.
Important: please only use the custom attach wrapper in the future.
* 🎨 token model had overriden the onCreating function because of the created_at field
- we need to ensure that the base onCreating hook get's triggered for ALL models
- if not, they don't get an ObjectId assigned
- in this case: be smart and check if the target model has a created_at field
* 🎨 we don't have a uuid field anymore, remove the usages
- no default uuid creation in models
- i am pretty sure we have some more definitions in our tests (for example in the export json files), but that is too much work to delete them all
* 🎨 do not parse ID to Number
- we had various occurances of parsing all ID's to numbers
- we don't need this behaviour anymore
- ID is string
- i will adapt the ID validation in the next commit
* 🎨 change ID regex for validation
- we only allow: ID as ObjectId, ID as 1 and ID as me
- we need to keep ID 1, because our whole software relies on ID 1 (permissions etc)
* 🎨 owner fixture
- roles: [4] does not work anymore
- 4 means -> static id 4
- this worked in an auto increment system (not even in a system with distributed writes)
- with ObjectId we generate each ID automatically (for static and dynamic resources)
- it is possible to define all id's for static resources still, but that means we need to know which ID is already used and for consistency we have to define ObjectId's for these static resources
- so no static id's anymore, except of: id 1 for owner and id 0 for external usage (because this is required from our permission system)
- NOTE: please read through the comment in the user model
* 🎨 tests: DataGenerator and test utils
First of all: we need to ensure using ObjectId's in the tests. When don't, we can't ensure that ObjectId's work properly.
This commit brings lot's of dynamic into all the static defined id's.
In one of the next commits, i will adapt all the tests.
* 🚨 remove counter in Notification API
- no need to add a counter
- we simply generate ObjectId's (they are auto incremental as well)
- our id validator does only allow ObjectId as id,1 and me
* 🎨 extend contextUser in Base Model
- remove isNumber check, because id's are no longer numbers, except of id 0/1
- use existing isExternalUser
- support id 0/1 as string or number
* ✨ Ghost Owner has id 1
- ensure we define this id in the fixtures.json
- doesn't matter if number or string
* 🎨 functional tests adaptions
- use dynamic id's
* 🎨 fix unit tests
* 🎨 integration tests adaptions
* 🎨 change importer utils
- all our export examples (test/fixtures/exports) contain id's as numbers
- fact: but we ignore them anyway when inserting into the database, see https://github.com/TryGhost/Ghost/blob/master/core/server/data/import/utils.js#L249
- in https://github.com/TryGhost/Ghost/pull/7495/commits/0e6ed957cd54dc02a25cf6fb1ab7d7e723295e2c#diff-70f514a06347c048648be464819503c4L67 i removed parsing id's to integers
- i realised that this ^ check just existed, because the userIdToMap was an object key and object keys are always strings!
- i think this logic is a little bit complicated, but i don't want to refactor this now
- this commit ensures when trying to find the user, the id comparison works again
- i've added more documentation to understand this logic ;)
- plus i renamed an attribute to improve readability
* 🎨 Data-Generator: add more defaults to createUser
- if i use the function DataGenerator.forKnex.createUser i would like to get a full set of defaults
* 🎨 test utils: change/extend function set for functional tests
- functional tests work a bit different
- they boot Ghost and seed the database
- some functional tests have mis-used the test setup
- the test setup needs two sections: integration/unit and functional tests
- any functional test is allowed to either add more data or change data in the existing Ghost db
- but what it should not do is: add test fixtures like roles or users from our DataGenerator and cross fingers it will work
- this commit adds a clean method for functional tests to add extra users
* 🎨 functional tests adaptions
- use last commit to insert users for functional tests clean
- tidy up usage of testUtils.setup or testUtils.doAuth
* 🐛 test utils: reset database before init
- ensure we don't have any left data from other tests in the database when starting ghost
* 🐛 fix test (unrelated to this PR)
- fixes a random failure
- return statement was missing
* 🎨 make changes for invites
2016-11-17 10:09:11 +01:00
} ,
{
"from" : {
"model" : "User" ,
2017-01-25 22:08:09 +01:00
"match" : "id" ,
✨ replace auto increment id's by object id (#7495)
* 🛠 bookshelf tarball, bson-objectid
* 🎨 schema changes
- change increment type to string
- add a default fallback for string length 191 (to avoid adding this logic to every single column which uses an ID)
- remove uuid, because ID now represents a global resource identifier
- keep uuid for post, because we are using this as preview id
- keep uuid for clients for now - we are using this param for Ghost-Auth
* ✨ base model: generate ObjectId on creating event
- each new resource get's a auto generate ObjectId
- this logic won't work for attached models, this commit comes later
* 🎨 centralised attach method
When attaching models there are two things important two know
1. To be able to attach an ObjectId, we need to register the `onCreating` event the fetched model!This is caused by the Bookshelf design in general. On this target model we are attaching the new model.
2. We need to manually fetch the target model, because Bookshelf has a weird behaviour (which is known as a bug, see see https://github.com/tgriesser/bookshelf/issues/629). The most important property when attaching a model is `parentFk`, which is the foreign key. This can be null when fetching the model with the option `withRelated`. To ensure quality and consistency, the custom attach wrapper always fetches the target model manual. By fetching the target model (again) is a little performance decrease, but it also has advantages: we can register the event, and directly unregister the event again. So very clean code.
Important: please only use the custom attach wrapper in the future.
* 🎨 token model had overriden the onCreating function because of the created_at field
- we need to ensure that the base onCreating hook get's triggered for ALL models
- if not, they don't get an ObjectId assigned
- in this case: be smart and check if the target model has a created_at field
* 🎨 we don't have a uuid field anymore, remove the usages
- no default uuid creation in models
- i am pretty sure we have some more definitions in our tests (for example in the export json files), but that is too much work to delete them all
* 🎨 do not parse ID to Number
- we had various occurances of parsing all ID's to numbers
- we don't need this behaviour anymore
- ID is string
- i will adapt the ID validation in the next commit
* 🎨 change ID regex for validation
- we only allow: ID as ObjectId, ID as 1 and ID as me
- we need to keep ID 1, because our whole software relies on ID 1 (permissions etc)
* 🎨 owner fixture
- roles: [4] does not work anymore
- 4 means -> static id 4
- this worked in an auto increment system (not even in a system with distributed writes)
- with ObjectId we generate each ID automatically (for static and dynamic resources)
- it is possible to define all id's for static resources still, but that means we need to know which ID is already used and for consistency we have to define ObjectId's for these static resources
- so no static id's anymore, except of: id 1 for owner and id 0 for external usage (because this is required from our permission system)
- NOTE: please read through the comment in the user model
* 🎨 tests: DataGenerator and test utils
First of all: we need to ensure using ObjectId's in the tests. When don't, we can't ensure that ObjectId's work properly.
This commit brings lot's of dynamic into all the static defined id's.
In one of the next commits, i will adapt all the tests.
* 🚨 remove counter in Notification API
- no need to add a counter
- we simply generate ObjectId's (they are auto incremental as well)
- our id validator does only allow ObjectId as id,1 and me
* 🎨 extend contextUser in Base Model
- remove isNumber check, because id's are no longer numbers, except of id 0/1
- use existing isExternalUser
- support id 0/1 as string or number
* ✨ Ghost Owner has id 1
- ensure we define this id in the fixtures.json
- doesn't matter if number or string
* 🎨 functional tests adaptions
- use dynamic id's
* 🎨 fix unit tests
* 🎨 integration tests adaptions
* 🎨 change importer utils
- all our export examples (test/fixtures/exports) contain id's as numbers
- fact: but we ignore them anyway when inserting into the database, see https://github.com/TryGhost/Ghost/blob/master/core/server/data/import/utils.js#L249
- in https://github.com/TryGhost/Ghost/pull/7495/commits/0e6ed957cd54dc02a25cf6fb1ab7d7e723295e2c#diff-70f514a06347c048648be464819503c4L67 i removed parsing id's to integers
- i realised that this ^ check just existed, because the userIdToMap was an object key and object keys are always strings!
- i think this logic is a little bit complicated, but i don't want to refactor this now
- this commit ensures when trying to find the user, the id comparison works again
- i've added more documentation to understand this logic ;)
- plus i renamed an attribute to improve readability
* 🎨 Data-Generator: add more defaults to createUser
- if i use the function DataGenerator.forKnex.createUser i would like to get a full set of defaults
* 🎨 test utils: change/extend function set for functional tests
- functional tests work a bit different
- they boot Ghost and seed the database
- some functional tests have mis-used the test setup
- the test setup needs two sections: integration/unit and functional tests
- any functional test is allowed to either add more data or change data in the existing Ghost db
- but what it should not do is: add test fixtures like roles or users from our DataGenerator and cross fingers it will work
- this commit adds a clean method for functional tests to add extra users
* 🎨 functional tests adaptions
- use last commit to insert users for functional tests clean
- tidy up usage of testUtils.setup or testUtils.doAuth
* 🐛 test utils: reset database before init
- ensure we don't have any left data from other tests in the database when starting ghost
* 🐛 fix test (unrelated to this PR)
- fixes a random failure
- return statement was missing
* 🎨 make changes for invites
2016-11-17 10:09:11 +01:00
"relation" : "roles"
} ,
"to" : {
"model" : "Role" ,
"match" : "name"
} ,
"entries" : {
2017-01-25 22:08:09 +01:00
"1" : [ "Owner" ]
✨ replace auto increment id's by object id (#7495)
* 🛠 bookshelf tarball, bson-objectid
* 🎨 schema changes
- change increment type to string
- add a default fallback for string length 191 (to avoid adding this logic to every single column which uses an ID)
- remove uuid, because ID now represents a global resource identifier
- keep uuid for post, because we are using this as preview id
- keep uuid for clients for now - we are using this param for Ghost-Auth
* ✨ base model: generate ObjectId on creating event
- each new resource get's a auto generate ObjectId
- this logic won't work for attached models, this commit comes later
* 🎨 centralised attach method
When attaching models there are two things important two know
1. To be able to attach an ObjectId, we need to register the `onCreating` event the fetched model!This is caused by the Bookshelf design in general. On this target model we are attaching the new model.
2. We need to manually fetch the target model, because Bookshelf has a weird behaviour (which is known as a bug, see see https://github.com/tgriesser/bookshelf/issues/629). The most important property when attaching a model is `parentFk`, which is the foreign key. This can be null when fetching the model with the option `withRelated`. To ensure quality and consistency, the custom attach wrapper always fetches the target model manual. By fetching the target model (again) is a little performance decrease, but it also has advantages: we can register the event, and directly unregister the event again. So very clean code.
Important: please only use the custom attach wrapper in the future.
* 🎨 token model had overriden the onCreating function because of the created_at field
- we need to ensure that the base onCreating hook get's triggered for ALL models
- if not, they don't get an ObjectId assigned
- in this case: be smart and check if the target model has a created_at field
* 🎨 we don't have a uuid field anymore, remove the usages
- no default uuid creation in models
- i am pretty sure we have some more definitions in our tests (for example in the export json files), but that is too much work to delete them all
* 🎨 do not parse ID to Number
- we had various occurances of parsing all ID's to numbers
- we don't need this behaviour anymore
- ID is string
- i will adapt the ID validation in the next commit
* 🎨 change ID regex for validation
- we only allow: ID as ObjectId, ID as 1 and ID as me
- we need to keep ID 1, because our whole software relies on ID 1 (permissions etc)
* 🎨 owner fixture
- roles: [4] does not work anymore
- 4 means -> static id 4
- this worked in an auto increment system (not even in a system with distributed writes)
- with ObjectId we generate each ID automatically (for static and dynamic resources)
- it is possible to define all id's for static resources still, but that means we need to know which ID is already used and for consistency we have to define ObjectId's for these static resources
- so no static id's anymore, except of: id 1 for owner and id 0 for external usage (because this is required from our permission system)
- NOTE: please read through the comment in the user model
* 🎨 tests: DataGenerator and test utils
First of all: we need to ensure using ObjectId's in the tests. When don't, we can't ensure that ObjectId's work properly.
This commit brings lot's of dynamic into all the static defined id's.
In one of the next commits, i will adapt all the tests.
* 🚨 remove counter in Notification API
- no need to add a counter
- we simply generate ObjectId's (they are auto incremental as well)
- our id validator does only allow ObjectId as id,1 and me
* 🎨 extend contextUser in Base Model
- remove isNumber check, because id's are no longer numbers, except of id 0/1
- use existing isExternalUser
- support id 0/1 as string or number
* ✨ Ghost Owner has id 1
- ensure we define this id in the fixtures.json
- doesn't matter if number or string
* 🎨 functional tests adaptions
- use dynamic id's
* 🎨 fix unit tests
* 🎨 integration tests adaptions
* 🎨 change importer utils
- all our export examples (test/fixtures/exports) contain id's as numbers
- fact: but we ignore them anyway when inserting into the database, see https://github.com/TryGhost/Ghost/blob/master/core/server/data/import/utils.js#L249
- in https://github.com/TryGhost/Ghost/pull/7495/commits/0e6ed957cd54dc02a25cf6fb1ab7d7e723295e2c#diff-70f514a06347c048648be464819503c4L67 i removed parsing id's to integers
- i realised that this ^ check just existed, because the userIdToMap was an object key and object keys are always strings!
- i think this logic is a little bit complicated, but i don't want to refactor this now
- this commit ensures when trying to find the user, the id comparison works again
- i've added more documentation to understand this logic ;)
- plus i renamed an attribute to improve readability
* 🎨 Data-Generator: add more defaults to createUser
- if i use the function DataGenerator.forKnex.createUser i would like to get a full set of defaults
* 🎨 test utils: change/extend function set for functional tests
- functional tests work a bit different
- they boot Ghost and seed the database
- some functional tests have mis-used the test setup
- the test setup needs two sections: integration/unit and functional tests
- any functional test is allowed to either add more data or change data in the existing Ghost db
- but what it should not do is: add test fixtures like roles or users from our DataGenerator and cross fingers it will work
- this commit adds a clean method for functional tests to add extra users
* 🎨 functional tests adaptions
- use last commit to insert users for functional tests clean
- tidy up usage of testUtils.setup or testUtils.doAuth
* 🐛 test utils: reset database before init
- ensure we don't have any left data from other tests in the database when starting ghost
* 🐛 fix test (unrelated to this PR)
- fixes a random failure
- return statement was missing
* 🎨 make changes for invites
2016-11-17 10:09:11 +01:00
}
2016-10-12 17:18:57 +02:00
}
]
}