Ghost/core/test/integration/api
Katharina Irrgang 9349e99e54 🐛 fix delete by author as transaction (#7145)
closes #7137

Deleting the content from the database runs in a transaction. see
https://github.com/TryGhost/Ghost/blob/master/core/server/api/users.js#L390

`destroyByAuthor` is one of the operations we trigger to delete all the conent, see https://github.com/TryGhost/Ghost/blob/master/core/server/models/post.js#L647

The post model has a specific hook for deleting content to delete the relations as well, see https://github.com/TryGhost/Ghost/blob/master/core/server/models/post.js#L122

This hook is part of the transaction. But the `options` are ignored. `(model/*, attr, options*/)` 
We use the `options` to forward the transaction reference, which we need to pass into the bookshelf queries. So `return model.load('tags').call('related', 'tags').call('detach')` does not forward the transaction and that's why it stucks when deleting the content.
2016-09-19 14:45:36 +01:00
..
advanced_browse_spec.js improvement: jshint/jscs 2016-06-17 22:59:47 +02:00
api_authentication_spec.js improvement: jshint/jscs 2016-06-17 22:59:47 +02:00
api_configuration_spec.js Switch to new native system font stack (#7219) 2016-08-18 20:29:46 +01:00
api_db_spec.js feature: upload validation middleware (#7208) 2016-08-18 20:25:51 +01:00
api_mail_spec.js improvement: jshint/jscs 2016-06-17 22:59:47 +02:00
api_notifications_spec.js Fix upgrade notification type value (#7308) 2016-09-01 17:58:46 +02:00
api_posts_spec.js fix: "url" field is undefined when restricting returned fields (#7089) 2016-07-18 22:21:47 +02:00
api_roles_spec.js improvement: jshint/jscs 2016-06-17 22:59:47 +02:00
api_schedules_spec.js improvement: jshint/jscs 2016-06-17 22:59:47 +02:00
api_settings_spec.js 💄 Remove duplicate test assertion (#7233) 2016-08-19 16:38:56 +02:00
api_slugs_spec.js improvement: jshint/jscs 2016-06-17 22:59:47 +02:00
api_subscription_spec.js feature: upload validation middleware (#7208) 2016-08-18 20:25:51 +01:00
api_tags_spec.js improvement: jshint/jscs 2016-06-17 22:59:47 +02:00
api_users_spec.js 🐛 fix delete by author as transaction (#7145) 2016-09-19 14:45:36 +01:00