gitlab-org--gitlab-foss/spec/services/projects
Stan Hu fea80aa12d Fix project deletion when feature visibility is set to private
Projects that are destroyed are put in the pending_delete state.
The ProjectDestroyWorker checks whether the current user has
access, but since the ProjectFeature class uses the default scope
of the Project, it will not be able to find the right project.

This was a regression in 8.12 that caused the following stack trace:

```
NoMethodError: undefined method `team' for nil:NilClass
  from app/models/project_feature.rb:62:in `get_permission'
  from app/models/project_feature.rb:34:in `feature_available?'
  from app/models/project.rb:21:in `feature_available?'
  from app/policies/project_policy.rb:170:in `disabled_features!'
  from app/policies/project_policy.rb:29:in `rules'
  from app/policies/base_policy.rb:82:in `block in abilities'
  from app/policies/base_policy.rb:113:in `collect_rules'
  from app/policies/base_policy.rb:82:in `abilities'
  from app/policies/base_policy.rb:50:in `abilities'
  from app/models/ability.rb:64:in `uncached_allowed'
  from app/models/ability.rb:58:in `allowed'
  from app/models/ability.rb:49:in `allowed?'
  from app/services/base_service.rb:11:in `can?'
  from lib/gitlab/metrics/instrumentation.rb:155:in `block in can?'
  from lib/gitlab/metrics/method_call.rb:23:in `measure'
  from lib/gitlab/metrics/instrumentation.rb:155:in `can?'
  from app/services/projects/destroy_service.rb:18:in `execute'
```

Closes #22948
2016-10-04 20:53:15 -07:00
..
autocomplete_service_spec.rb
create_service_spec.rb
destroy_service_spec.rb Fix project deletion when feature visibility is set to private 2016-10-04 20:53:15 -07:00
download_service_spec.rb
enable_deploy_key_service_spec.rb
fork_service_spec.rb
housekeeping_service_spec.rb Reset pushes_since_gc counter before specs run to ensure starting point is 0 2016-09-18 21:21:43 -07:00
import_service_spec.rb fix broken repo 500 errors in UI and added relevant specs 2016-09-29 16:58:14 +02:00
transfer_service_spec.rb
unlink_fork_service_spec.rb
update_service_spec.rb
upload_service_spec.rb