Commit Graph

12 Commits

Author SHA1 Message Date
Timothy Andrew 1c42505b02
Implement review comments from @DouweM for !10467.
1. Have `MigrateToGhostUser` be a service rather than a mixed-in module, to keep
   things explicit. Specs testing the behavior of this class are moved into a
   separate service spec file.

2. Add a `user.reported_abuse_reports` association to make the
   `migrate_abuse_reports` method more consistent with the other `migrate_`
   methods.
2017-04-06 22:39:40 +05:30
Timothy Andrew 3e1a1242c6
Move a user's award emoji to the ghost user
... when the user is destroyed.

1. Normally, for a given awardable and award emoji name, a user is only allowed
   to create a single award emoji.

2. This validation needs to be removed for ghost users, since:

   - User A and User B have created award emoji - with the same name and against
     the same awardable
   - User A is deleted. Their award emoji is moved to the ghost user
   - User B is deleted. Their award emoji needs to be moved to the ghost user.
     However, this breaks the uniqueness validation, since the ghost user is
     only allowed to have one award emoji of a given name for a given awardable
2017-04-06 18:59:17 +05:30
Timothy Andrew 97cbf7c223
Move a user's notes to the ghost user
... when the user is destroyed.
2017-04-06 18:58:59 +05:30
Timothy Andrew 72580f07af
Move a user's merge requests to the ghost user.
1. When the user is deleted.

2. Refactor out code relating to "migrating records to the ghost user" into a
   `MigrateToGhostUser` concern, which is tested using a shared example.
2017-04-06 18:58:57 +05:30
Rémy Coutable 4e3516788f Don't use FFaker in factories, use sequences instead
FFaker can generate data that randomly break our test suite. This
simplifies our factories and use sequences which are more predictive.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-04-03 18:54:48 +02:00
Robert Speicher ca9a79f620 Use `:empty_project` where possible in service specs 2017-03-27 20:44:09 -04:00
Douwe Maan c10064aad5 Enable Style/SpaceInsideBrackets 2017-02-23 09:31:56 -06:00
wendy0402 9a24db121c fix issue creation from milestone doesn't assign the milestone 2017-02-12 09:02:03 +07:00
Semyon Pupkov 3deb66ea56 Add traits for ProjectFeatures to Project factory
https://gitlab.com/gitlab-org/gitlab-ce/issues/24007
2017-02-05 13:11:45 +05:00
Felipe Artur 1b082a4c33 Check if user can read issue before being assigned 2016-12-27 19:25:17 -02:00
Mark Fletcher 9f97fa4d9f Ensure issuable state changes only fire webhooks once
* Webhooks for close and reopen events now fired in respective services only
* Prevents generic 'update' webhooks firing too
2016-12-16 10:52:59 +00:00
Rémy Coutable adab5dba43 Fix permission for setting an issue's due date
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-09-28 17:41:32 +02:00