Remove usages of `Organization` default factory
We need to remove all the usages of `create(:organization, :default)` This is a list of feature categories and specs that still reference them. The ones that have a prefix '#' are already done. So: pick a feature category and create an MR for removing the creation of the organization. Please update this description: put the `#` in front of the lines that have the spec file name that you want to work on. - Sometimes we don't need an organization anymore (since it is created when a namespace is created) - Sometimes it can be just a normal organization (ie without the trait `:default`) - Sometimes, the actual code has a dependency on it. Investigate if it can be removed ## Current status For the legacy cell, we will keep a default organization. ### What is left ``` spec/lib/gitlab/current/organization_spec.rb:14 - create let_it_be(:default_organization) { create(:organization, :default) } spec/lib/gitlab/database_importers/default_organization_importer_spec.rb:26 - create let!(:default_org) { create(:organization, :default) } spec/models/organizations/organization_spec.rb:353 - create let_it_be(:default_organization) { create(:organization, :default) } ee/spec/requests/api/admin/security/compliance_policy_settings_spec.rb:9 - create let_it_be(:default_organization) { create(:organization, :default) } # rubocop:disable Gitlab/RSpec/AvoidCreateDefaultOrganization -- API manages self-managed instance-wide setting. Support for organization-level settings will be added later. ```
task