diff options
Diffstat (limited to 'spec')
664 files changed, 1460 insertions, 1464 deletions
diff --git a/spec/controllers/admin/application_settings_controller_spec.rb b/spec/controllers/admin/application_settings_controller_spec.rb index 23ab2b141cf..2565622f8df 100644 --- a/spec/controllers/admin/application_settings_controller_spec.rb +++ b/spec/controllers/admin/application_settings_controller_spec.rb @@ -4,7 +4,7 @@ describe Admin::ApplicationSettingsController do include StubENV let(:group) { create(:group) } - let(:project) { create(:empty_project, namespace: group) } + let(:project) { create(:project, namespace: group) } let(:admin) { create(:admin) } let(:user) { create(:user)} diff --git a/spec/controllers/admin/dashboard_controller_spec.rb b/spec/controllers/admin/dashboard_controller_spec.rb index b290c45cdd4..6eb9f7867d5 100644 --- a/spec/controllers/admin/dashboard_controller_spec.rb +++ b/spec/controllers/admin/dashboard_controller_spec.rb @@ -8,8 +8,8 @@ describe Admin::DashboardController do it 'does not retrieve projects that are pending deletion' do sign_in(create(:admin)) - project = create(:empty_project) - pending_delete_project = create(:empty_project, pending_delete: true) + project = create(:project) + pending_delete_project = create(:project, pending_delete: true) get :index diff --git a/spec/controllers/admin/groups_controller_spec.rb b/spec/controllers/admin/groups_controller_spec.rb index ddf38967dd7..0dad95e418f 100644 --- a/spec/controllers/admin/groups_controller_spec.rb +++ b/spec/controllers/admin/groups_controller_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Admin::GroupsController do let(:group) { create(:group) } - let(:project) { create(:empty_project, namespace: group) } + let(:project) { create(:project, namespace: group) } let(:admin) { create(:admin) } before do diff --git a/spec/controllers/admin/projects_controller_spec.rb b/spec/controllers/admin/projects_controller_spec.rb index 2c35d394b74..65587064eb1 100644 --- a/spec/controllers/admin/projects_controller_spec.rb +++ b/spec/controllers/admin/projects_controller_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Admin::ProjectsController do - let!(:project) { create(:empty_project, :public) } + let!(:project) { create(:project, :public) } before do sign_in(create(:admin)) diff --git a/spec/controllers/admin/services_controller_spec.rb b/spec/controllers/admin/services_controller_spec.rb index 4ca0cfc74e9..249bd948847 100644 --- a/spec/controllers/admin/services_controller_spec.rb +++ b/spec/controllers/admin/services_controller_spec.rb @@ -8,7 +8,7 @@ describe Admin::ServicesController do end describe 'GET #edit' do - let!(:project) { create(:empty_project) } + let!(:project) { create(:project) } Service.available_services_names.each do |service_name| context "#{service_name}" do @@ -27,7 +27,7 @@ describe Admin::ServicesController do end describe "#update" do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let!(:service) do RedmineService.create( project: project, diff --git a/spec/controllers/admin/users_controller_spec.rb b/spec/controllers/admin/users_controller_spec.rb index 69928a906c6..29c449d6aa9 100644 --- a/spec/controllers/admin/users_controller_spec.rb +++ b/spec/controllers/admin/users_controller_spec.rb @@ -9,7 +9,7 @@ describe Admin::UsersController do end describe 'DELETE #user with projects' do - let(:project) { create(:empty_project, namespace: user.namespace) } + let(:project) { create(:project, namespace: user.namespace) } let!(:issue) { create(:issue, author: user) } before do diff --git a/spec/controllers/autocomplete_controller_spec.rb b/spec/controllers/autocomplete_controller_spec.rb index fa5660050ec..3c396e36b24 100644 --- a/spec/controllers/autocomplete_controller_spec.rb +++ b/spec/controllers/autocomplete_controller_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe AutocompleteController do - let!(:project) { create(:empty_project) } + let!(:project) { create(:project) } let!(:user) { create(:user) } context 'GET users' do @@ -65,7 +65,7 @@ describe AutocompleteController do end context 'non-member login for public project' do - let!(:project) { create(:empty_project, :public) } + let!(:project) { create(:project, :public) } before do sign_in(non_member) @@ -127,7 +127,7 @@ describe AutocompleteController do end context 'unauthenticated user' do - let(:public_project) { create(:empty_project, :public) } + let(:public_project) { create(:project, :public) } let(:body) { JSON.parse(response.body) } describe 'GET #users with public project' do @@ -231,8 +231,8 @@ describe AutocompleteController do end context 'GET projects' do - let(:authorized_project) { create(:empty_project) } - let(:authorized_search_project) { create(:empty_project, name: 'rugged') } + let(:authorized_project) { create(:project) } + let(:authorized_search_project) { create(:project, name: 'rugged') } before do sign_in(user) @@ -289,8 +289,8 @@ describe AutocompleteController do context 'authorized projects apply limit' do before do - authorized_project2 = create(:empty_project) - authorized_project3 = create(:empty_project) + authorized_project2 = create(:project) + authorized_project3 = create(:project) authorized_project.add_master(user) authorized_project2.add_master(user) @@ -315,8 +315,8 @@ describe AutocompleteController do context 'authorized projects with offset' do before do - authorized_project2 = create(:empty_project) - authorized_project3 = create(:empty_project) + authorized_project2 = create(:project) + authorized_project3 = create(:project) authorized_project.add_master(user) authorized_project2.add_master(user) diff --git a/spec/controllers/dashboard/labels_controller_spec.rb b/spec/controllers/dashboard/labels_controller_spec.rb index 2b63933008f..a3bfb2f3a87 100644 --- a/spec/controllers/dashboard/labels_controller_spec.rb +++ b/spec/controllers/dashboard/labels_controller_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Dashboard::LabelsController do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } let!(:label) { create(:label, project: project) } @@ -11,7 +11,7 @@ describe Dashboard::LabelsController do end describe "#index" do - let!(:unrelated_label) { create(:label, project: create(:empty_project, :public)) } + let!(:unrelated_label) { create(:label, project: create(:project, :public)) } it 'returns global labels for projects the user has a relationship with' do get :index, format: :json diff --git a/spec/controllers/dashboard/milestones_controller_spec.rb b/spec/controllers/dashboard/milestones_controller_spec.rb index 424f39fd3b8..2dcb67d50f4 100644 --- a/spec/controllers/dashboard/milestones_controller_spec.rb +++ b/spec/controllers/dashboard/milestones_controller_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Dashboard::MilestonesController do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } let(:project_milestone) { create(:milestone, project: project) } let(:milestone) do diff --git a/spec/controllers/dashboard/todos_controller_spec.rb b/spec/controllers/dashboard/todos_controller_spec.rb index 4a48621abe1..c8c6b9f41bf 100644 --- a/spec/controllers/dashboard/todos_controller_spec.rb +++ b/spec/controllers/dashboard/todos_controller_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Dashboard::TodosController do let(:user) { create(:user) } let(:author) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:todo_service) { TodoService.new } before do @@ -14,7 +14,7 @@ describe Dashboard::TodosController do describe 'GET #index' do context 'project authorization' do it 'renders 404 when user does not have read access on given project' do - unauthorized_project = create(:empty_project, :private) + unauthorized_project = create(:project, :private) get :index, project_id: unauthorized_project.id @@ -34,7 +34,7 @@ describe Dashboard::TodosController do end it 'renders 200 when user has access on given project' do - authorized_project = create(:empty_project, :public) + authorized_project = create(:project, :public) get :index, project_id: authorized_project.id diff --git a/spec/controllers/dashboard_controller_spec.rb b/spec/controllers/dashboard_controller_spec.rb index 05561946e9b..566d8515198 100644 --- a/spec/controllers/dashboard_controller_spec.rb +++ b/spec/controllers/dashboard_controller_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe DashboardController do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } before do project.team << [user, :master] diff --git a/spec/controllers/explore/projects_controller_spec.rb b/spec/controllers/explore/projects_controller_spec.rb index 9dceeca168d..2845f258f6f 100644 --- a/spec/controllers/explore/projects_controller_spec.rb +++ b/spec/controllers/explore/projects_controller_spec.rb @@ -3,8 +3,8 @@ require 'spec_helper' describe Explore::ProjectsController do describe 'GET #trending' do context 'sorting by update date' do - let(:project1) { create(:empty_project, :public, updated_at: 3.days.ago) } - let(:project2) { create(:empty_project, :public, updated_at: 1.day.ago) } + let(:project1) { create(:project, :public, updated_at: 3.days.ago) } + let(:project2) { create(:project, :public, updated_at: 1.day.ago) } before do create(:trending_project, project: project1) diff --git a/spec/controllers/groups/milestones_controller_spec.rb b/spec/controllers/groups/milestones_controller_spec.rb index aad67dd0164..fbbc67f3ae0 100644 --- a/spec/controllers/groups/milestones_controller_spec.rb +++ b/spec/controllers/groups/milestones_controller_spec.rb @@ -2,8 +2,8 @@ require 'spec_helper' describe Groups::MilestonesController do let(:group) { create(:group) } - let!(:project) { create(:empty_project, group: group) } - let!(:project2) { create(:empty_project, group: group) } + let!(:project) { create(:project, group: group) } + let!(:project2) { create(:project, group: group) } let(:user) { create(:user) } let(:title) { '肯定不是中文的问题' } let(:milestone) do diff --git a/spec/controllers/groups_controller_spec.rb b/spec/controllers/groups_controller_spec.rb index c4092303a67..c2ada8c8df7 100644 --- a/spec/controllers/groups_controller_spec.rb +++ b/spec/controllers/groups_controller_spec.rb @@ -3,7 +3,7 @@ require 'rails_helper' describe GroupsController do let(:user) { create(:user) } let(:group) { create(:group, :public) } - let(:project) { create(:empty_project, namespace: group) } + let(:project) { create(:project, namespace: group) } let!(:group_member) { create(:group_member, group: group, user: user) } describe 'GET #index' do diff --git a/spec/controllers/import/bitbucket_controller_spec.rb b/spec/controllers/import/bitbucket_controller_spec.rb index 8ef10dabd4c..e8707760a5a 100644 --- a/spec/controllers/import/bitbucket_controller_spec.rb +++ b/spec/controllers/import/bitbucket_controller_spec.rb @@ -52,7 +52,7 @@ describe Import::BitbucketController do end it "assigns variables" do - @project = create(:empty_project, import_type: 'bitbucket', creator_id: user.id) + @project = create(:project, import_type: 'bitbucket', creator_id: user.id) allow_any_instance_of(Bitbucket::Client).to receive(:repos).and_return([@repo]) get :status @@ -63,7 +63,7 @@ describe Import::BitbucketController do end it "does not show already added project" do - @project = create(:empty_project, import_type: 'bitbucket', creator_id: user.id, import_source: 'asd/vim') + @project = create(:project, import_type: 'bitbucket', creator_id: user.id, import_source: 'asd/vim') allow_any_instance_of(Bitbucket::Client).to receive(:repos).and_return([@repo]) get :status diff --git a/spec/controllers/import/fogbugz_controller_spec.rb b/spec/controllers/import/fogbugz_controller_spec.rb index fffbc805335..5f0f6dea821 100644 --- a/spec/controllers/import/fogbugz_controller_spec.rb +++ b/spec/controllers/import/fogbugz_controller_spec.rb @@ -16,7 +16,7 @@ describe Import::FogbugzController do end it 'assigns variables' do - @project = create(:empty_project, import_type: 'fogbugz', creator_id: user.id) + @project = create(:project, import_type: 'fogbugz', creator_id: user.id) stub_client(repos: [@repo]) get :status @@ -26,7 +26,7 @@ describe Import::FogbugzController do end it 'does not show already added project' do - @project = create(:empty_project, import_type: 'fogbugz', creator_id: user.id, import_source: 'vim') + @project = create(:project, import_type: 'fogbugz', creator_id: user.id, import_source: 'vim') stub_client(repos: [@repo]) get :status diff --git a/spec/controllers/import/gitlab_controller_spec.rb b/spec/controllers/import/gitlab_controller_spec.rb index 997107dadea..faf1e6f63ea 100644 --- a/spec/controllers/import/gitlab_controller_spec.rb +++ b/spec/controllers/import/gitlab_controller_spec.rb @@ -36,7 +36,7 @@ describe Import::GitlabController do end it "assigns variables" do - @project = create(:empty_project, import_type: 'gitlab', creator_id: user.id) + @project = create(:project, import_type: 'gitlab', creator_id: user.id) stub_client(projects: [@repo]) get :status @@ -46,7 +46,7 @@ describe Import::GitlabController do end it "does not show already added project" do - @project = create(:empty_project, import_type: 'gitlab', creator_id: user.id, import_source: 'asd/vim') + @project = create(:project, import_type: 'gitlab', creator_id: user.id, import_source: 'asd/vim') stub_client(projects: [@repo]) get :status diff --git a/spec/controllers/import/google_code_controller_spec.rb b/spec/controllers/import/google_code_controller_spec.rb index c96fb90f70e..4241db6e771 100644 --- a/spec/controllers/import/google_code_controller_spec.rb +++ b/spec/controllers/import/google_code_controller_spec.rb @@ -27,7 +27,7 @@ describe Import::GoogleCodeController do end it "assigns variables" do - @project = create(:empty_project, import_type: 'google_code', creator_id: user.id) + @project = create(:project, import_type: 'google_code', creator_id: user.id) stub_client(repos: [@repo], incompatible_repos: []) get :status @@ -38,7 +38,7 @@ describe Import::GoogleCodeController do end it "does not show already added project" do - @project = create(:empty_project, import_type: 'google_code', creator_id: user.id, import_source: 'vim') + @project = create(:project, import_type: 'google_code', creator_id: user.id, import_source: 'vim') stub_client(repos: [@repo], incompatible_repos: []) get :status diff --git a/spec/controllers/notification_settings_controller_spec.rb b/spec/controllers/notification_settings_controller_spec.rb index 6b690407ce3..bef815ee1f7 100644 --- a/spec/controllers/notification_settings_controller_spec.rb +++ b/spec/controllers/notification_settings_controller_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe NotificationSettingsController do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:group) { create(:group, :internal) } let(:user) { create(:user) } @@ -99,7 +99,7 @@ describe NotificationSettingsController do end context 'not authorized' do - let(:private_project) { create(:empty_project, :private) } + let(:private_project) { create(:project, :private) } before do sign_in(user) diff --git a/spec/controllers/projects/avatars_controller_spec.rb b/spec/controllers/projects/avatars_controller_spec.rb index 8b71d6518bb..f5ea097af8b 100644 --- a/spec/controllers/projects/avatars_controller_spec.rb +++ b/spec/controllers/projects/avatars_controller_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Projects::AvatarsController do - let(:project) { create(:empty_project, avatar: fixture_file_upload(Rails.root + "spec/fixtures/dk.png", "image/png")) } + let(:project) { create(:project, avatar: fixture_file_upload(Rails.root + "spec/fixtures/dk.png", "image/png")) } let(:user) { create(:user) } before do diff --git a/spec/controllers/projects/blob_controller_spec.rb b/spec/controllers/projects/blob_controller_spec.rb index 19ee5e3bb7e..59f33197e8f 100644 --- a/spec/controllers/projects/blob_controller_spec.rb +++ b/spec/controllers/projects/blob_controller_spec.rb @@ -193,7 +193,7 @@ describe Projects::BlobController do context "when user doesn't have access" do before do - other_project = create(:empty_project) + other_project = create(:project, :repository) merge_request.update!(source_project: other_project, target_project: other_project) end diff --git a/spec/controllers/projects/boards/issues_controller_spec.rb b/spec/controllers/projects/boards/issues_controller_spec.rb index dc3b72c6de4..3f6c1092163 100644 --- a/spec/controllers/projects/boards/issues_controller_spec.rb +++ b/spec/controllers/projects/boards/issues_controller_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Projects::Boards::IssuesController do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:board) { create(:board, project: project) } let(:user) { create(:user) } let(:guest) { create(:user) } diff --git a/spec/controllers/projects/boards/lists_controller_spec.rb b/spec/controllers/projects/boards/lists_controller_spec.rb index 0f2664262e8..65beec16307 100644 --- a/spec/controllers/projects/boards/lists_controller_spec.rb +++ b/spec/controllers/projects/boards/lists_controller_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Projects::Boards::ListsController do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:board) { create(:board, project: project) } let(:user) { create(:user) } let(:guest) { create(:user) } diff --git a/spec/controllers/projects/boards_controller_spec.rb b/spec/controllers/projects/boards_controller_spec.rb index aed3a45c413..9e2e9a39481 100644 --- a/spec/controllers/projects/boards_controller_spec.rb +++ b/spec/controllers/projects/boards_controller_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Projects::BoardsController do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } before do diff --git a/spec/controllers/projects/branches_controller_spec.rb b/spec/controllers/projects/branches_controller_spec.rb index 24defb4d657..745d051a5c1 100644 --- a/spec/controllers/projects/branches_controller_spec.rb +++ b/spec/controllers/projects/branches_controller_spec.rb @@ -96,7 +96,7 @@ describe Projects::BranchesController do end context 'repository-less project' do - let(:project) { create :empty_project } + let(:project) { create :project } it 'redirects to newly created branch' do result = { status: :success, branch: double(name: branch) } diff --git a/spec/controllers/projects/deploy_keys_controller_spec.rb b/spec/controllers/projects/deploy_keys_controller_spec.rb index efe1a78415b..c3208357694 100644 --- a/spec/controllers/projects/deploy_keys_controller_spec.rb +++ b/spec/controllers/projects/deploy_keys_controller_spec.rb @@ -24,8 +24,8 @@ describe Projects::DeployKeysController do end context 'when json requested' do - let(:project2) { create(:empty_project, :internal)} - let(:project_private) { create(:empty_project, :private)} + let(:project2) { create(:project, :internal)} + let(:project_private) { create(:project, :private)} let(:deploy_key_internal) do create(:deploy_key, key: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCdMHEHyhRjbhEZVddFn6lTWdgEy5Q6Bz4nwGB76xWZI5YT/1WJOMEW+sL5zYd31kk7sd3FJ5L9ft8zWMWrr/iWXQikC2cqZK24H1xy+ZUmrRuJD4qGAaIVoyyzBL+avL+lF8J5lg6YSw8gwJY/lX64/vnJHUlWw2n5BF8IFOWhiw== dummy@gitlab.com') diff --git a/spec/controllers/projects/deployments_controller_spec.rb b/spec/controllers/projects/deployments_controller_spec.rb index 0dbfcf97f6f..3daff1eeea3 100644 --- a/spec/controllers/projects/deployments_controller_spec.rb +++ b/spec/controllers/projects/deployments_controller_spec.rb @@ -4,7 +4,7 @@ describe Projects::DeploymentsController do include ApiHelpers let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:environment) { create(:environment, name: 'production', project: project) } before do diff --git a/spec/controllers/projects/environments_controller_spec.rb b/spec/controllers/projects/environments_controller_spec.rb index f88f50c3cc6..5a95f4f6199 100644 --- a/spec/controllers/projects/environments_controller_spec.rb +++ b/spec/controllers/projects/environments_controller_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Projects::EnvironmentsController do set(:user) { create(:user) } - set(:project) { create(:empty_project) } + set(:project) { create(:project) } set(:environment) do create(:environment, name: 'production', project: project) diff --git a/spec/controllers/projects/group_links_controller_spec.rb b/spec/controllers/projects/group_links_controller_spec.rb index 019a50882ab..f8c792cd0f0 100644 --- a/spec/controllers/projects/group_links_controller_spec.rb +++ b/spec/controllers/projects/group_links_controller_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Projects::GroupLinksController do let(:group) { create(:group, :private) } let(:group2) { create(:group, :private) } - let(:project) { create(:empty_project, :private, group: group2) } + let(:project) { create(:project, :private, group: group2) } let(:user) { create(:user) } before do diff --git a/spec/controllers/projects/hooks_controller_spec.rb b/spec/controllers/projects/hooks_controller_spec.rb index b93ab220f4d..07174660f46 100644 --- a/spec/controllers/projects/hooks_controller_spec.rb +++ b/spec/controllers/projects/hooks_controller_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Projects::HooksController do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } before do diff --git a/spec/controllers/projects/imports_controller_spec.rb b/spec/controllers/projects/imports_controller_spec.rb index 9be61342616..2a5ec6d584b 100644 --- a/spec/controllers/projects/imports_controller_spec.rb +++ b/spec/controllers/projects/imports_controller_spec.rb @@ -5,7 +5,7 @@ describe Projects::ImportsController do describe 'GET #show' do context 'when repository does not exists' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } before do sign_in(user) diff --git a/spec/controllers/projects/issues_controller_spec.rb b/spec/controllers/projects/issues_controller_spec.rb index 2c57f3bcf8d..bdee3894a13 100644 --- a/spec/controllers/projects/issues_controller_spec.rb +++ b/spec/controllers/projects/issues_controller_spec.rb @@ -234,7 +234,7 @@ describe Projects::IssuesController do end context 'when moving issue to another private project' do - let(:another_project) { create(:empty_project, :private) } + let(:another_project) { create(:project, :private) } context 'when user has access to move issue' do before do @@ -594,7 +594,7 @@ describe Projects::IssuesController do describe 'POST #create' do def post_new_issue(issue_attrs = {}, additional_params = {}) sign_in(user) - project = create(:empty_project, :public) + project = create(:project, :public) project.team << [user, :developer] post :create, { @@ -817,7 +817,7 @@ describe Projects::IssuesController do context "when the user is owner" do let(:owner) { create(:user) } let(:namespace) { create(:namespace, owner: owner) } - let(:project) { create(:empty_project, namespace: namespace) } + let(:project) { create(:project, namespace: namespace) } before do sign_in(owner) diff --git a/spec/controllers/projects/jobs_controller_spec.rb b/spec/controllers/projects/jobs_controller_spec.rb index 5a295ae47a6..fdd7e6f173f 100644 --- a/spec/controllers/projects/jobs_controller_spec.rb +++ b/spec/controllers/projects/jobs_controller_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Projects::JobsController do include ApiHelpers - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:pipeline) { create(:ci_pipeline, project: project) } let(:user) { create(:user) } diff --git a/spec/controllers/projects/labels_controller_spec.rb b/spec/controllers/projects/labels_controller_spec.rb index f19ad4c2c81..f4e2dca883d 100644 --- a/spec/controllers/projects/labels_controller_spec.rb +++ b/spec/controllers/projects/labels_controller_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Projects::LabelsController do let(:group) { create(:group) } - let(:project) { create(:empty_project, namespace: group) } + let(:project) { create(:project, namespace: group) } let(:user) { create(:user) } before do @@ -73,7 +73,7 @@ describe Projects::LabelsController do describe 'POST #generate' do context 'personal project' do - let(:personal_project) { create(:empty_project, namespace: user.namespace) } + let(:personal_project) { create(:project, namespace: user.namespace) } it 'creates labels' do post :generate, namespace_id: personal_project.namespace.to_param, project_id: personal_project diff --git a/spec/controllers/projects/mattermosts_controller_spec.rb b/spec/controllers/projects/mattermosts_controller_spec.rb index 12e413db902..4eea7041d29 100644 --- a/spec/controllers/projects/mattermosts_controller_spec.rb +++ b/spec/controllers/projects/mattermosts_controller_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Projects::MattermostsController do - let!(:project) { create(:empty_project) } + let!(:project) { create(:project) } let!(:user) { create(:user) } before do diff --git a/spec/controllers/projects/merge_requests/diffs_controller_spec.rb b/spec/controllers/projects/merge_requests/diffs_controller_spec.rb index fd6cb3c5dbb..fad2c8f3ab7 100644 --- a/spec/controllers/projects/merge_requests/diffs_controller_spec.rb +++ b/spec/controllers/projects/merge_requests/diffs_controller_spec.rb @@ -145,7 +145,7 @@ describe Projects::MergeRequests::DiffsController do end context 'when the merge request belongs to a different project' do - let(:other_project) { create(:empty_project) } + let(:other_project) { create(:project) } before do other_project.team << [user, :master] diff --git a/spec/controllers/projects/milestones_controller_spec.rb b/spec/controllers/projects/milestones_controller_spec.rb index bb5a340cd96..62f1fb1f697 100644 --- a/spec/controllers/projects/milestones_controller_spec.rb +++ b/spec/controllers/projects/milestones_controller_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Projects::MilestonesController do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } let(:milestone) { create(:milestone, project: project) } let(:issue) { create(:issue, project: project, milestone: milestone) } diff --git a/spec/controllers/projects/notes_controller_spec.rb b/spec/controllers/projects/notes_controller_spec.rb index 4a6eb76e71f..f280c55059c 100644 --- a/spec/controllers/projects/notes_controller_spec.rb +++ b/spec/controllers/projects/notes_controller_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Projects::NotesController do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:issue) { create(:issue, project: project) } let(:note) { create(:note, noteable: issue, project: project) } diff --git a/spec/controllers/projects/pages_controller_spec.rb b/spec/controllers/projects/pages_controller_spec.rb index df35d8e86b9..4d0111302f3 100644 --- a/spec/controllers/projects/pages_controller_spec.rb +++ b/spec/controllers/projects/pages_controller_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Projects::PagesController do let(:user) { create(:user) } - let(:project) { create(:empty_project, :public, :access_requestable) } + let(:project) { create(:project, :public, :access_requestable) } let(:request_params) do { diff --git a/spec/controllers/projects/pages_domains_controller_spec.rb b/spec/controllers/projects/pages_domains_controller_spec.rb index 920189be381..ad4d7da3bdd 100644 --- a/spec/controllers/projects/pages_domains_controller_spec.rb +++ b/spec/controllers/projects/pages_domains_controller_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Projects::PagesDomainsController do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let!(:pages_domain) { create(:pages_domain, project: project) } let(:request_params) do diff --git a/spec/controllers/projects/pipeline_schedules_controller_spec.rb b/spec/controllers/projects/pipeline_schedules_controller_spec.rb index 41bf5580993..4ac0559c679 100644 --- a/spec/controllers/projects/pipeline_schedules_controller_spec.rb +++ b/spec/controllers/projects/pipeline_schedules_controller_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Projects::PipelineSchedulesController do include AccessMatchersForController - set(:project) { create(:empty_project, :public) } + set(:project) { create(:project, :public) } let!(:pipeline_schedule) { create(:ci_pipeline_schedule, project: project) } describe 'GET #index' do diff --git a/spec/controllers/projects/pipelines_controller_spec.rb b/spec/controllers/projects/pipelines_controller_spec.rb index ed63e4dec26..f9d77c7ad03 100644 --- a/spec/controllers/projects/pipelines_controller_spec.rb +++ b/spec/controllers/projects/pipelines_controller_spec.rb @@ -4,7 +4,7 @@ describe Projects::PipelinesController do include ApiHelpers let(:user) { create(:user) } - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:feature) { ProjectFeature::DISABLED } before do diff --git a/spec/controllers/projects/project_members_controller_spec.rb b/spec/controllers/projects/project_members_controller_spec.rb index 8671d7a78dd..3cb1bec5ea2 100644 --- a/spec/controllers/projects/project_members_controller_spec.rb +++ b/spec/controllers/projects/project_members_controller_spec.rb @@ -2,7 +2,7 @@ require('spec_helper') describe Projects::ProjectMembersController do let(:user) { create(:user) } - let(:project) { create(:empty_project, :public, :access_requestable) } + let(:project) { create(:project, :public, :access_requestable) } describe 'GET index' do it 'should have the project_members address with a 200 status code' do @@ -158,7 +158,7 @@ describe Projects::ProjectMembersController do end context 'and is an owner' do - let(:project) { create(:empty_project, namespace: user.namespace) } + let(:project) { create(:project, namespace: user.namespace) } before do project.team << [user, :master] @@ -261,7 +261,7 @@ describe Projects::ProjectMembersController do end describe 'POST apply_import' do - let(:another_project) { create(:empty_project, :private) } + let(:another_project) { create(:project, :private) } let(:member) { create(:user) } before do diff --git a/spec/controllers/projects/prometheus_controller_spec.rb b/spec/controllers/projects/prometheus_controller_spec.rb index eddf7275975..8407a53272a 100644 --- a/spec/controllers/projects/prometheus_controller_spec.rb +++ b/spec/controllers/projects/prometheus_controller_spec.rb @@ -2,7 +2,7 @@ require('spec_helper') describe Projects::PrometheusController do let(:user) { create(:user) } - let!(:project) { create(:empty_project) } + let!(:project) { create(:project) } let(:prometheus_service) { double('prometheus_service') } diff --git a/spec/controllers/projects/registry/repositories_controller_spec.rb b/spec/controllers/projects/registry/repositories_controller_spec.rb index 464302824a8..2805968dcd9 100644 --- a/spec/controllers/projects/registry/repositories_controller_spec.rb +++ b/spec/controllers/projects/registry/repositories_controller_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Projects::Registry::RepositoriesController do let(:user) { create(:user) } - let(:project) { create(:empty_project, :private) } + let(:project) { create(:project, :private) } before do sign_in(user) diff --git a/spec/controllers/projects/registry/tags_controller_spec.rb b/spec/controllers/projects/registry/tags_controller_spec.rb index a823516830e..f4af3587d23 100644 --- a/spec/controllers/projects/registry/tags_controller_spec.rb +++ b/spec/controllers/projects/registry/tags_controller_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Projects::Registry::TagsController do let(:user) { create(:user) } - let(:project) { create(:empty_project, :private) } + let(:project) { create(:project, :private) } before do sign_in(user) diff --git a/spec/controllers/projects/runners_controller_spec.rb b/spec/controllers/projects/runners_controller_spec.rb index 0fa249e4405..2b6f988fd9c 100644 --- a/spec/controllers/projects/runners_controller_spec.rb +++ b/spec/controllers/projects/runners_controller_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Projects::RunnersController do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:runner) { create(:ci_runner) } let(:params) do diff --git a/spec/controllers/projects/services_controller_spec.rb b/spec/controllers/projects/services_controller_spec.rb index 5a9d8a75f3e..4e9b0c09ff2 100644 --- a/spec/controllers/projects/services_controller_spec.rb +++ b/spec/controllers/projects/services_controller_spec.rb @@ -28,7 +28,7 @@ describe Projects::ServicesController do context 'success' do context 'with empty project' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } context 'with chat notification service' do let(:service) { project.create_microsoft_teams_service(webhook: 'http://webhook.com') } diff --git a/spec/controllers/projects/settings/ci_cd_controller_spec.rb b/spec/controllers/projects/settings/ci_cd_controller_spec.rb index e9a91cff1b3..a8f4b79b64c 100644 --- a/spec/controllers/projects/settings/ci_cd_controller_spec.rb +++ b/spec/controllers/projects/settings/ci_cd_controller_spec.rb @@ -1,7 +1,7 @@ require('spec_helper') describe Projects::Settings::CiCdController do - let(:project) { create(:empty_project, :public, :access_requestable) } + let(:project) { create(:project, :public, :access_requestable) } let(:user) { create(:user) } before do diff --git a/spec/controllers/projects/settings/integrations_controller_spec.rb b/spec/controllers/projects/settings/integrations_controller_spec.rb index 65f7bb34f4a..e0f9a5b24a6 100644 --- a/spec/controllers/projects/settings/integrations_controller_spec.rb +++ b/spec/controllers/projects/settings/integrations_controller_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Projects::Settings::IntegrationsController do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:user) { create(:user) } before do diff --git a/spec/controllers/projects/snippets_controller_spec.rb b/spec/controllers/projects/snippets_controller_spec.rb index 1f082ce7102..cc444f31797 100644 --- a/spec/controllers/projects/snippets_controller_spec.rb +++ b/spec/controllers/projects/snippets_controller_spec.rb @@ -156,7 +156,7 @@ describe Projects::SnippetsController do end describe 'PUT #update' do - let(:project) { create :empty_project, :public } + let(:project) { create :project, :public } let(:snippet) { create :project_snippet, author: user, project: project, visibility_level: visibility_level } def update_snippet(snippet_params = {}, additional_params = {}) diff --git a/spec/controllers/projects/todos_controller_spec.rb b/spec/controllers/projects/todos_controller_spec.rb index c5a4153d991..974330e2bbd 100644 --- a/spec/controllers/projects/todos_controller_spec.rb +++ b/spec/controllers/projects/todos_controller_spec.rb @@ -2,7 +2,7 @@ require('spec_helper') describe Projects::TodosController do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:issue) { create(:issue, project: project) } let(:merge_request) { create(:merge_request, source_project: project) } diff --git a/spec/controllers/projects/uploads_controller_spec.rb b/spec/controllers/projects/uploads_controller_spec.rb index cd6961a7bd5..488bcf31371 100644 --- a/spec/controllers/projects/uploads_controller_spec.rb +++ b/spec/controllers/projects/uploads_controller_spec.rb @@ -1,7 +1,7 @@ require('spec_helper') describe Projects::UploadsController do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } let(:jpg) { fixture_file_upload(Rails.root + 'spec/fixtures/rails_sample.jpg', 'image/jpg') } let(:txt) { fixture_file_upload(Rails.root + 'spec/fixtures/doc_sample.txt', 'text/plain') } diff --git a/spec/controllers/projects/variables_controller_spec.rb b/spec/controllers/projects/variables_controller_spec.rb index da06fcb7cfb..6957fb43c19 100644 --- a/spec/controllers/projects/variables_controller_spec.rb +++ b/spec/controllers/projects/variables_controller_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Projects::VariablesController do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } before do diff --git a/spec/controllers/projects_controller_spec.rb b/spec/controllers/projects_controller_spec.rb index 9f19cc30582..34095ef6250 100644 --- a/spec/controllers/projects_controller_spec.rb +++ b/spec/controllers/projects_controller_spec.rb @@ -1,8 +1,8 @@ require('spec_helper') describe ProjectsController do - let(:project) { create(:empty_project) } - let(:public_project) { create(:empty_project, :public) } + let(:project) { create(:project) } + let(:public_project) { create(:project, :public) } let(:user) { create(:user) } let(:jpg) { fixture_file_upload(Rails.root + 'spec/fixtures/rails_sample.jpg', 'image/jpg') } let(:txt) { fixture_file_upload(Rails.root + 'spec/fixtures/doc_sample.txt', 'text/plain') } @@ -34,7 +34,7 @@ describe ProjectsController do end context "user does not have access to project" do - let(:private_project) { create(:empty_project, :private) } + let(:private_project) { create(:project, :private) } it "does not initialize notification setting" do get :show, namespace_id: private_project.namespace, id: private_project @@ -176,7 +176,7 @@ describe ProjectsController do end context "when the url contains .atom" do - let(:public_project_with_dot_atom) { build(:empty_project, :public, name: 'my.atom', path: 'my.atom') } + let(:public_project_with_dot_atom) { build(:project, :public, name: 'my.atom', path: 'my.atom') } it 'expects an error creating the project' do expect(public_project_with_dot_atom).not_to be_valid @@ -185,7 +185,7 @@ describe ProjectsController do context 'when the project is pending deletions' do it 'renders a 404 error' do - project = create(:empty_project, pending_delete: true) + project = create(:project, pending_delete: true) sign_in(user) get :show, namespace_id: project.namespace, id: project @@ -196,7 +196,7 @@ describe ProjectsController do context "redirection from http://someproject.git" do it 'redirects to project page (format.html)' do - project = create(:empty_project, :public) + project = create(:project, :public) get :show, namespace_id: project.namespace, id: project, format: :git @@ -408,7 +408,7 @@ describe ProjectsController do end context 'when project not forked' do - let(:unforked_project) { create(:empty_project, namespace: user.namespace) } + let(:unforked_project) { create(:project, namespace: user.namespace) } it 'does nothing if project was not forked' do delete(:remove_fork, diff --git a/spec/controllers/search_controller_spec.rb b/spec/controllers/search_controller_spec.rb index a3708ad0908..37f961d0c94 100644 --- a/spec/controllers/search_controller_spec.rb +++ b/spec/controllers/search_controller_spec.rb @@ -8,7 +8,7 @@ describe SearchController do end it 'finds issue comments' do - project = create(:empty_project, :public) + project = create(:project, :public) note = create(:note_on_issue, project: project) get :show, project_id: project.id, scope: 'notes', search: note.note @@ -23,7 +23,7 @@ describe SearchController do end it "doesn't expose comments on issues" do - project = create(:empty_project, :public, :issues_private) + project = create(:project, :public, :issues_private) note = create(:note_on_issue, project: project) get :show, project_id: project.id, scope: 'notes', search: note.note @@ -33,7 +33,7 @@ describe SearchController do end it "doesn't expose comments on merge_requests" do - project = create(:empty_project, :public, :merge_requests_private) + project = create(:project, :public, :merge_requests_private) note = create(:note_on_merge_request, project: project) get :show, project_id: project.id, scope: 'notes', search: note.note @@ -42,7 +42,7 @@ describe SearchController do end it "doesn't expose comments on snippets" do - project = create(:empty_project, :public, :snippets_private) + project = create(:project, :public, :snippets_private) note = create(:note_on_project_snippet, project: project) get :show, project_id: project.id, scope: 'notes', search: note.note diff --git a/spec/controllers/sent_notifications_controller_spec.rb b/spec/controllers/sent_notifications_controller_spec.rb index 5d2734b8827..31593ce7311 100644 --- a/spec/controllers/sent_notifications_controller_spec.rb +++ b/spec/controllers/sent_notifications_controller_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' describe SentNotificationsController do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:sent_notification) { create(:sent_notification, project: project, noteable: issue, recipient: user) } let(:issue) do diff --git a/spec/controllers/snippets_controller_spec.rb b/spec/controllers/snippets_controller_spec.rb index a6edcca08f4..475ceda11fe 100644 --- a/spec/controllers/snippets_controller_spec.rb +++ b/spec/controllers/snippets_controller_spec.rb @@ -273,7 +273,7 @@ describe SnippetsController do end describe 'PUT #update' do - let(:project) { create :empty_project } + let(:project) { create :project } let(:snippet) { create :personal_snippet, author: user, project: project, visibility_level: visibility_level } def update_snippet(snippet_params = {}, additional_params = {}) diff --git a/spec/controllers/uploads_controller_spec.rb b/spec/controllers/uploads_controller_spec.rb index 96f719e2b82..b3a40f5d15c 100644 --- a/spec/controllers/uploads_controller_spec.rb +++ b/spec/controllers/uploads_controller_spec.rb @@ -131,7 +131,7 @@ describe UploadsController do describe "GET show" do context 'Content-Disposition security measures' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } context 'for PNG files' do it 'returns Content-Disposition: inline' do @@ -203,7 +203,7 @@ describe UploadsController do end context "when viewing a project avatar" do - let!(:project) { create(:empty_project, avatar: fixture_file_upload(Rails.root + "spec/fixtures/dk.png", "image/png")) } + let!(:project) { create(:project, avatar: fixture_file_upload(Rails.root + "spec/fixtures/dk.png", "image/png")) } context "when the project is public" do before do diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb index 7aeb6efd86d..a64ad73cba8 100644 --- a/spec/controllers/users_controller_spec.rb +++ b/spec/controllers/users_controller_spec.rb @@ -86,7 +86,7 @@ describe UsersController do end context 'forked project' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:forked_project) { Projects::ForkService.new(project, user).execute } before do @@ -104,7 +104,7 @@ describe UsersController do end describe 'GET #calendar_activities' do - let!(:project) { create(:empty_project) } + let!(:project) { create(:project) } let(:user) { create(:user) } before do diff --git a/spec/factories/boards.rb b/spec/factories/boards.rb index 4df9aef2846..1ec042a6ab4 100644 --- a/spec/factories/boards.rb +++ b/spec/factories/boards.rb @@ -1,6 +1,6 @@ FactoryGirl.define do factory :board do - project factory: :empty_project + project after(:create) do |board| board.lists.create(list_type: :closed) diff --git a/spec/factories/ci/pipeline_schedule.rb b/spec/factories/ci/pipeline_schedule.rb index a716da46ac6..564fef6833b 100644 --- a/spec/factories/ci/pipeline_schedule.rb +++ b/spec/factories/ci/pipeline_schedule.rb @@ -5,7 +5,7 @@ FactoryGirl.define do ref 'master' active true description "pipeline schedule" - project factory: :empty_project + project trait :nightly do cron '0 1 * * *' diff --git a/spec/factories/ci/pipelines.rb b/spec/factories/ci/pipelines.rb index 35803f0c37f..e83a0e599a8 100644 --- a/spec/factories/ci/pipelines.rb +++ b/spec/factories/ci/pipelines.rb @@ -5,7 +5,7 @@ FactoryGirl.define do sha '97de212e80737a608d939f648d959671fb0a0142' status 'pending' - project factory: :empty_project + project factory :ci_pipeline_without_jobs do after(:build) do |pipeline| diff --git a/spec/factories/ci/runner_projects.rb b/spec/factories/ci/runner_projects.rb index 33a17cf7ed5..fa76d0ecd8c 100644 --- a/spec/factories/ci/runner_projects.rb +++ b/spec/factories/ci/runner_projects.rb @@ -1,6 +1,6 @@ FactoryGirl.define do factory :ci_runner_project, class: Ci::RunnerProject do runner factory: :ci_runner - project factory: :empty_project + project end end diff --git a/spec/factories/ci/variables.rb b/spec/factories/ci/variables.rb index f83366136fd..d8fd513ffcf 100644 --- a/spec/factories/ci/variables.rb +++ b/spec/factories/ci/variables.rb @@ -7,6 +7,6 @@ FactoryGirl.define do protected true end - project factory: :empty_project + project end end diff --git a/spec/factories/commits.rb b/spec/factories/commits.rb index 89e260cf65b..f4f12a095fc 100644 --- a/spec/factories/commits.rb +++ b/spec/factories/commits.rb @@ -3,7 +3,7 @@ require_relative '../support/repo_helpers' FactoryGirl.define do factory :commit do git_commit RepoHelpers.sample_commit - project factory: :empty_project + project initialize_with do new(git_commit, project) diff --git a/spec/factories/deploy_keys_projects.rb b/spec/factories/deploy_keys_projects.rb index 75f8982ecd9..27cece487bd 100644 --- a/spec/factories/deploy_keys_projects.rb +++ b/spec/factories/deploy_keys_projects.rb @@ -1,6 +1,6 @@ FactoryGirl.define do factory :deploy_keys_project do deploy_key - project factory: :empty_project + project end end diff --git a/spec/factories/environments.rb b/spec/factories/environments.rb index d8d699fb3aa..9034476d094 100644 --- a/spec/factories/environments.rb +++ b/spec/factories/environments.rb @@ -2,12 +2,10 @@ FactoryGirl.define do factory :environment, class: Environment do sequence(:name) { |n| "environment#{n}" } - project factory: :empty_project + association :project, :repository sequence(:external_url) { |n| "https://env#{n}.example.gitlab.com" } trait :with_review_app do |environment| - project - transient do ref 'master' end diff --git a/spec/factories/events.rb b/spec/factories/events.rb index 55727d6b62c..11d2016955c 100644 --- a/spec/factories/events.rb +++ b/spec/factories/events.rb @@ -1,6 +1,6 @@ FactoryGirl.define do factory :event do - project factory: :empty_project + project author factory: :user trait(:created) { action Event::CREATED } diff --git a/spec/factories/file_uploaders.rb b/spec/factories/file_uploaders.rb index d397dd705a5..622571390d2 100644 --- a/spec/factories/file_uploaders.rb +++ b/spec/factories/file_uploaders.rb @@ -2,7 +2,7 @@ FactoryGirl.define do factory :file_uploader do skip_create - project factory: :empty_project + project secret nil transient do diff --git a/spec/factories/forked_project_links.rb b/spec/factories/forked_project_links.rb index 66b0f248959..9b34651a4ae 100644 --- a/spec/factories/forked_project_links.rb +++ b/spec/factories/forked_project_links.rb @@ -1,7 +1,7 @@ FactoryGirl.define do factory :forked_project_link do - association :forked_to_project, factory: :project - association :forked_from_project, factory: :project + association :forked_to_project, factory: [:project, :repository] + association :forked_from_project, factory: [:project, :repository] after(:create) do |link| link.forked_from_project.reload @@ -9,7 +9,7 @@ FactoryGirl.define do end trait :forked_to_empty_project do - association :forked_to_project, factory: :empty_project + association :forked_to_project, factory: [:project, :repository] end end end diff --git a/spec/factories/issues.rb b/spec/factories/issues.rb index a16695cb7c1..7c3b80198f9 100644 --- a/spec/factories/issues.rb +++ b/spec/factories/issues.rb @@ -2,7 +2,7 @@ FactoryGirl.define do factory :issue do title { generate(:title) } author - project factory: :empty_project + project trait :confidential do confidential true diff --git a/spec/factories/label_priorities.rb b/spec/factories/label_priorities.rb index f25939d2d3e..7430466fc57 100644 --- a/spec/factories/label_priorities.rb +++ b/spec/factories/label_priorities.rb @@ -1,6 +1,6 @@ FactoryGirl.define do factory :label_priority do - project factory: :empty_project + project label sequence(:priority) end diff --git a/spec/factories/labels.rb b/spec/factories/labels.rb index 22c2a1f15e2..416317d677b 100644 --- a/spec/factories/labels.rb +++ b/spec/factories/labels.rb @@ -5,7 +5,7 @@ FactoryGirl.define do end factory :label, traits: [:base_label], class: ProjectLabel do - project factory: :empty_project + project transient do priority nil diff --git a/spec/factories/milestones.rb b/spec/factories/milestones.rb index b5e2ec60072..2f75bf12cd7 100644 --- a/spec/factories/milestones.rb +++ b/spec/factories/milestones.rb @@ -27,7 +27,7 @@ FactoryGirl.define do elsif evaluator.project_id milestone.project_id = evaluator.project_id else - milestone.project = create(:empty_project) + milestone.project = create(:project) end end diff --git a/spec/factories/notes.rb b/spec/factories/notes.rb index 046974dcd6e..f0d05504b7e 100644 --- a/spec/factories/notes.rb +++ b/spec/factories/notes.rb @@ -4,7 +4,7 @@ include ActionDispatch::TestProcess FactoryGirl.define do factory :note do - project factory: :empty_project + project note { generate(:title) } author on_issue diff --git a/spec/factories/notification_settings.rb b/spec/factories/notification_settings.rb index ee41997e41a..e9171528d86 100644 --- a/spec/factories/notification_settings.rb +++ b/spec/factories/notification_settings.rb @@ -1,6 +1,6 @@ FactoryGirl.define do factory :notification_setting do - source factory: :empty_project + source factory: :project user level 3 end diff --git a/spec/factories/project_group_links.rb b/spec/factories/project_group_links.rb index 50341d943f5..e73cc05f9d7 100644 --- a/spec/factories/project_group_links.rb +++ b/spec/factories/project_group_links.rb @@ -1,6 +1,6 @@ FactoryGirl.define do factory :project_group_link do - project factory: :empty_project + project group end end diff --git a/spec/factories/project_hooks.rb b/spec/factories/project_hooks.rb index d754e980931..accae636a3a 100644 --- a/spec/factories/project_hooks.rb +++ b/spec/factories/project_hooks.rb @@ -2,7 +2,7 @@ FactoryGirl.define do factory :project_hook do url { generate(:url) } enable_ssl_verification false - project factory: :empty_project + project trait :token do token { SecureRandom.hex(10) } diff --git a/spec/factories/project_members.rb b/spec/factories/project_members.rb index fe4518caadf..9cf3a1e8e8a 100644 --- a/spec/factories/project_members.rb +++ b/spec/factories/project_members.rb @@ -1,7 +1,7 @@ FactoryGirl.define do factory :project_member do user - project factory: :empty_project + project master trait(:guest) { access_level ProjectMember::GUEST } diff --git a/spec/factories/project_wikis.rb b/spec/factories/project_wikis.rb index ae222d5e69a..38fcab7466d 100644 --- a/spec/factories/project_wikis.rb +++ b/spec/factories/project_wikis.rb @@ -2,7 +2,7 @@ FactoryGirl.define do factory :project_wiki do skip_create - project factory: :empty_project + project user factory: :user initialize_with { new(project, user) } end diff --git a/spec/factories/projects.rb b/spec/factories/projects.rb index 1c0ed63a37d..be3f219e8bf 100644 --- a/spec/factories/projects.rb +++ b/spec/factories/projects.rb @@ -54,9 +54,7 @@ FactoryGirl.define do avatar { File.open(Rails.root.join('spec/fixtures/dk.png')) } end - # Project with test repository - # - # Repository source is at https://gitlab.com/gitlab-org/gitlab-test + # Test repository - https://gitlab.com/gitlab-org/gitlab-test trait :repository do path { 'gitlabhq' } diff --git a/spec/factories/releases.rb b/spec/factories/releases.rb index 6a6d6fa171f..74497dc82c0 100644 --- a/spec/factories/releases.rb +++ b/spec/factories/releases.rb @@ -2,6 +2,6 @@ FactoryGirl.define do factory :release do tag "v1.1.0" description "Awesome release" - project factory: :empty_project + project end end diff --git a/spec/factories/sent_notifications.rb b/spec/factories/sent_notifications.rb index 99253be5a22..c2febf5b438 100644 --- a/spec/factories/sent_notifications.rb +++ b/spec/factories/sent_notifications.rb @@ -1,6 +1,6 @@ FactoryGirl.define do factory :sent_notification do - project factory: :empty_project + project recipient factory: :user noteable { create(:issue, project: project) } reply_key { SentNotification.reply_key } diff --git a/spec/factories/services.rb b/spec/factories/services.rb index 30bc25cf88a..c2674ce2d11 100644 --- a/spec/factories/services.rb +++ b/spec/factories/services.rb @@ -1,11 +1,11 @@ FactoryGirl.define do factory :service do - project factory: :empty_project + project type 'Service' end factory :custom_issue_tracker_service, class: CustomIssueTrackerService do - project factory: :empty_project + project type 'CustomIssueTrackerService' category 'issue_tracker' active true @@ -17,7 +17,7 @@ FactoryGirl.define do end factory :kubernetes_service do - project factory: :empty_project + project active true properties({ api_url: 'https://kubernetes.example.com', @@ -26,7 +26,7 @@ FactoryGirl.define do end factory :prometheus_service do - project factory: :empty_project + project active true properties({ api_url: 'https://prometheus.example.com/' @@ -34,7 +34,7 @@ FactoryGirl.define do end factory :jira_service do - project factory: :empty_project + project active true properties( url: 'https://jira.example.com', @@ -43,7 +43,7 @@ FactoryGirl.define do end factory :hipchat_service do - project factory: :empty_project + project type 'HipchatService' token 'test_token' end diff --git a/spec/factories/snippets.rb b/spec/factories/snippets.rb index f6ce99d50f9..075bccd7f94 100644 --- a/spec/factories/snippets.rb +++ b/spec/factories/snippets.rb @@ -20,7 +20,7 @@ FactoryGirl.define do end factory :project_snippet, parent: :snippet, class: :ProjectSnippet do - project factory: :empty_project + project end factory :personal_snippet, parent: :snippet, class: :PersonalSnippet do diff --git a/spec/factories/subscriptions.rb b/spec/factories/subscriptions.rb index b11b0a0a17b..1ae7fc9f384 100644 --- a/spec/factories/subscriptions.rb +++ b/spec/factories/subscriptions.rb @@ -1,7 +1,7 @@ FactoryGirl.define do factory :subscription do user - project factory: :empty_project + project subscribable factory: :issue end end diff --git a/spec/factories/todos.rb b/spec/factories/todos.rb index c1ac3bb84ad..4975befbfe3 100644 --- a/spec/factories/todos.rb +++ b/spec/factories/todos.rb @@ -1,6 +1,6 @@ FactoryGirl.define do factory :todo do - project factory: :empty_project + project author user target factory: :issue @@ -45,7 +45,7 @@ FactoryGirl.define do end factory :on_commit_todo, class: Todo do - project factory: :empty_project + project author user action { Todo::ASSIGNED } diff --git a/spec/factories/uploads.rb b/spec/factories/uploads.rb index f49dbe6dc9e..3222c41c3d8 100644 --- a/spec/factories/uploads.rb +++ b/spec/factories/uploads.rb @@ -1,6 +1,6 @@ FactoryGirl.define do factory :upload do - model { build(:empty_project) } + model { build(:project) } path { "uploads/-/system/project/avatar/avatar.jpg" } size 100.kilobytes uploader "AvatarUploader" diff --git a/spec/features/admin/admin_disables_git_access_protocol_spec.rb b/spec/features/admin/admin_disables_git_access_protocol_spec.rb index 931f4ec3d24..9ea3cfa72c6 100644 --- a/spec/features/admin/admin_disables_git_access_protocol_spec.rb +++ b/spec/features/admin/admin_disables_git_access_protocol_spec.rb @@ -3,7 +3,7 @@ require 'rails_helper' feature 'Admin disables Git access protocol' do include StubENV - let(:project) { create(:empty_project, :empty_repo) } + let(:project) { create(:project, :empty_repo) } let(:admin) { create(:admin) } background do diff --git a/spec/features/admin/admin_groups_spec.rb b/spec/features/admin/admin_groups_spec.rb index 2e1bfcdcec3..3768727d8ae 100644 --- a/spec/features/admin/admin_groups_spec.rb +++ b/spec/features/admin/admin_groups_spec.rb @@ -165,7 +165,7 @@ feature 'Admin Groups' do describe 'shared projects' do it 'renders shared project' do - empty_project = create(:empty_project) + empty_project = create(:project) empty_project.project_group_links.create!( group_access: Gitlab::Access::MASTER, group: group diff --git a/spec/features/admin/admin_hook_logs_spec.rb b/spec/features/admin/admin_hook_logs_spec.rb index 7910d5fb72b..710822ac042 100644 --- a/spec/features/admin/admin_hook_logs_spec.rb +++ b/spec/features/admin/admin_hook_logs_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' feature 'Admin::HookLogs' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:system_hook) { create(:system_hook) } let(:hook_log) { create(:web_hook_log, web_hook: system_hook, internal_error_message: 'some error') } diff --git a/spec/features/admin/admin_hooks_spec.rb b/spec/features/admin/admin_hooks_spec.rb index 141109fd464..30fcb334b60 100644 --- a/spec/features/admin/admin_hooks_spec.rb +++ b/spec/features/admin/admin_hooks_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe 'Admin::Hooks' do before do - @project = create(:empty_project) + @project = create(:project) sign_in(create(:admin)) @system_hook = create(:system_hook) diff --git a/spec/features/admin/admin_projects_spec.rb b/spec/features/admin/admin_projects_spec.rb index 4f69eafcb9d..77710f80036 100644 --- a/spec/features/admin/admin_projects_spec.rb +++ b/spec/features/admin/admin_projects_spec.rb @@ -4,7 +4,7 @@ describe "Admin::Projects" do include Select2Helper let(:user) { create :user } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:current_user) { create(:admin) } before do @@ -12,7 +12,7 @@ describe "Admin::Projects" do end describe "GET /admin/projects" do - let!(:archived_project) { create :empty_project, :public, :archived } + let!(:archived_project) { create :project, :public, :archived } before do expect(project).to be_persisted diff --git a/spec/features/admin/admin_runners_spec.rb b/spec/features/admin/admin_runners_spec.rb index 46bab3763cc..e3bb16af38a 100644 --- a/spec/features/admin/admin_runners_spec.rb +++ b/spec/features/admin/admin_runners_spec.rb @@ -65,8 +65,8 @@ describe "Admin Runners" do let(:runner) { FactoryGirl.create :ci_runner } before do - @project1 = FactoryGirl.create(:empty_project) - @project2 = FactoryGirl.create(:empty_project) + @project1 = FactoryGirl.create(:project) + @project2 = FactoryGirl.create(:project) visit admin_runner_path(runner) end diff --git a/spec/features/admin/admin_users_spec.rb b/spec/features/admin/admin_users_spec.rb index 0dde8bb696c..e2e2b13cf8a 100644 --- a/spec/features/admin/admin_users_spec.rb +++ b/spec/features/admin/admin_users_spec.rb @@ -257,7 +257,7 @@ describe "Admin::Users" do describe "GET /admin/users/:id/projects" do let(:group) { create(:group) } - let!(:project) { create(:empty_project, group: group) } + let!(:project) { create(:project, group: group) } before do group.add_developer(user) diff --git a/spec/features/admin/admin_uses_repository_checks_spec.rb b/spec/features/admin/admin_uses_repository_checks_spec.rb index 5b3ee6ee822..c2b7543a690 100644 --- a/spec/features/admin/admin_uses_repository_checks_spec.rb +++ b/spec/features/admin/admin_uses_repository_checks_spec.rb @@ -9,7 +9,7 @@ feature 'Admin uses repository checks' do end scenario 'to trigger a single check' do - project = create(:empty_project) + project = create(:project) visit_admin_project_page(project) page.within('.repository-check') do @@ -20,7 +20,7 @@ feature 'Admin uses repository checks' do end scenario 'to see a single failed repository check' do - project = create(:empty_project) + project = create(:project) project.update_columns( last_repository_check_failed: true, last_repository_check_at: Time.now diff --git a/spec/features/atom/dashboard_issues_spec.rb b/spec/features/atom/dashboard_issues_spec.rb index d70da7f09e9..5aae2dbaf91 100644 --- a/spec/features/atom/dashboard_issues_spec.rb +++ b/spec/features/atom/dashboard_issues_spec.rb @@ -4,8 +4,8 @@ describe "Dashboard Issues Feed" do describe "GET /issues" do let!(:user) { create(:user, email: 'private1@example.com', public_email: 'public1@example.com') } let!(:assignee) { create(:user, email: 'private2@example.com', public_email: 'public2@example.com') } - let!(:project1) { create(:empty_project) } - let!(:project2) { create(:empty_project) } + let!(:project1) { create(:project) } + let!(:project2) { create(:project) } before do project1.team << [user, :master] diff --git a/spec/features/atom/dashboard_spec.rb b/spec/features/atom/dashboard_spec.rb index a7c12853981..321c8a2a670 100644 --- a/spec/features/atom/dashboard_spec.rb +++ b/spec/features/atom/dashboard_spec.rb @@ -19,7 +19,7 @@ describe "Dashboard Feed" do end context 'feed content' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:issue) { create(:issue, project: project, author: user, description: '') } let(:note) { create(:note, noteable: issue, author: user, note: 'Bug confirmed', project: project) } diff --git a/spec/features/atom/issues_spec.rb b/spec/features/atom/issues_spec.rb index 59e20d7e24d..3eeb4d35131 100644 --- a/spec/features/atom/issues_spec.rb +++ b/spec/features/atom/issues_spec.rb @@ -5,7 +5,7 @@ describe 'Issues Feed' do let!(:user) { create(:user, email: 'private1@example.com', public_email: 'public1@example.com') } let!(:assignee) { create(:user, email: 'private2@example.com', public_email: 'public2@example.com') } let!(:group) { create(:group) } - let!(:project) { create(:empty_project) } + let!(:project) { create(:project) } let!(:issue) { create(:issue, author: user, assignees: [assignee], project: project) } before do diff --git a/spec/features/boards/add_issues_modal_spec.rb b/spec/features/boards/add_issues_modal_spec.rb index c87469696da..a6ad5981f8f 100644 --- a/spec/features/boards/add_issues_modal_spec.rb +++ b/spec/features/boards/add_issues_modal_spec.rb @@ -1,7 +1,7 @@ require 'rails_helper' describe 'Issue Boards add issue modal', :js do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:board) { create(:board, project: project) } let(:user) { create(:user) } let!(:planning) { create(:label, project: project, name: 'Planning') } diff --git a/spec/features/boards/boards_spec.rb b/spec/features/boards/boards_spec.rb index c3711c9b2c5..c51b81c1cff 100644 --- a/spec/features/boards/boards_spec.rb +++ b/spec/features/boards/boards_spec.rb @@ -4,7 +4,7 @@ describe 'Issue Boards', js: true do include DragTo let(:group) { create(:group, :nested) } - let(:project) { create(:empty_project, :public, namespace: group) } + let(:project) { create(:project, :public, namespace: group) } let(:board) { create(:board, project: project) } let(:user) { create(:user) } let!(:user2) { create(:user) } diff --git a/spec/features/boards/issue_ordering_spec.rb b/spec/features/boards/issue_ordering_spec.rb index f4be56a4463..4cbb48e2e6e 100644 --- a/spec/features/boards/issue_ordering_spec.rb +++ b/spec/features/boards/issue_ordering_spec.rb @@ -3,7 +3,7 @@ require 'rails_helper' describe 'Issue Boards', :js do include DragTo - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:board) { create(:board, project: project) } let(:user) { create(:user) } let(:label) { create(:label, project: project) } diff --git a/spec/features/boards/keyboard_shortcut_spec.rb b/spec/features/boards/keyboard_shortcut_spec.rb index 415eda0e058..61b53aa5d1e 100644 --- a/spec/features/boards/keyboard_shortcut_spec.rb +++ b/spec/features/boards/keyboard_shortcut_spec.rb @@ -1,7 +1,7 @@ require 'rails_helper' describe 'Issue Boards shortcut', js: true do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } before do create(:board, project: project) diff --git a/spec/features/boards/modal_filter_spec.rb b/spec/features/boards/modal_filter_spec.rb index 1c8b9c46569..422d96175f7 100644 --- a/spec/features/boards/modal_filter_spec.rb +++ b/spec/features/boards/modal_filter_spec.rb @@ -1,7 +1,7 @@ require 'rails_helper' describe 'Issue Boards add issue modal filtering', :js do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:board) { create(:board, project: project) } let(:planning) { create(:label, project: project, name: 'Planning') } let!(:list1) { create(:list, board: board, label: planning, position: 0) } diff --git a/spec/features/boards/new_issue_spec.rb b/spec/features/boards/new_issue_spec.rb index 1dbe3dbda11..f67372337ec 100644 --- a/spec/features/boards/new_issue_spec.rb +++ b/spec/features/boards/new_issue_spec.rb @@ -1,7 +1,7 @@ require 'rails_helper' describe 'Issue Boards new issue', js: true do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:board) { create(:board, project: project) } let!(:list) { create(:list, board: board, position: 0) } let(:user) { create(:user) } diff --git a/spec/features/boards/sidebar_spec.rb b/spec/features/boards/sidebar_spec.rb index 3f58fe1c32c..373cd92793e 100644 --- a/spec/features/boards/sidebar_spec.rb +++ b/spec/features/boards/sidebar_spec.rb @@ -3,7 +3,7 @@ require 'rails_helper' describe 'Issue Boards', js: true do let(:user) { create(:user) } let(:user2) { create(:user) } - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let!(:milestone) { create(:milestone, project: project) } let!(:development) { create(:label, project: project, name: 'Development') } let!(:bug) { create(:label, project: project, name: 'Bug') } diff --git a/spec/features/boards/sub_group_project_spec.rb b/spec/features/boards/sub_group_project_spec.rb index f54f2234203..11a54079f4f 100644 --- a/spec/features/boards/sub_group_project_spec.rb +++ b/spec/features/boards/sub_group_project_spec.rb @@ -3,7 +3,7 @@ require 'rails_helper' describe 'Sub-group project issue boards', :js do let(:group) { create(:group) } let(:nested_group_1) { create(:group, parent: group) } - let(:project) { create(:empty_project, group: nested_group_1) } + let(:project) { create(:project, group: nested_group_1) } let(:board) { create(:board, project: project) } let(:label) { create(:label, project: project) } let(:user) { create(:user) } diff --git a/spec/features/calendar_spec.rb b/spec/features/calendar_spec.rb index 1e7fd7b62bd..64fbc80cb81 100644 --- a/spec/features/calendar_spec.rb +++ b/spec/features/calendar_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'Contributions Calendar', :js do let(:user) { create(:user) } - let(:contributed_project) { create(:empty_project, :public) } + let(:contributed_project) { create(:project, :public) } let(:issue_note) { create(:note, project: contributed_project) } # Ex/ Sunday Jan 1, 2016 diff --git a/spec/features/container_registry_spec.rb b/spec/features/container_registry_spec.rb index 8f59ce3d2e7..ae39ba4da6b 100644 --- a/spec/features/container_registry_spec.rb +++ b/spec/features/container_registry_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe "Container Registry" do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:container_repository) do create(:container_repository, name: 'my/image') diff --git a/spec/features/dashboard/activity_spec.rb b/spec/features/dashboard/activity_spec.rb index a96270c9147..4917dfcf1d1 100644 --- a/spec/features/dashboard/activity_spec.rb +++ b/spec/features/dashboard/activity_spec.rb @@ -17,7 +17,7 @@ feature 'Dashboard > Activity' do end context 'event filters', :js do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:merge_request) do create(:merge_request, author: user, source_project: project, target_project: project) diff --git a/spec/features/dashboard/archived_projects_spec.rb b/spec/features/dashboard/archived_projects_spec.rb index ceac6a0a27c..814ec0e59c7 100644 --- a/spec/features/dashboard/archived_projects_spec.rb +++ b/spec/features/dashboard/archived_projects_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' RSpec.describe 'Dashboard Archived Project' do let(:user) { create :user } let(:project) { create :project} - let(:archived_project) { create(:empty_project, :archived) } + let(:archived_project) { create(:project, :archived) } before do project.team << [user, :master] diff --git a/spec/features/dashboard/datetime_on_tooltips_spec.rb b/spec/features/dashboard/datetime_on_tooltips_spec.rb index 05dcdd93f37..b6dce1b8ec4 100644 --- a/spec/features/dashboard/datetime_on_tooltips_spec.rb +++ b/spec/features/dashboard/datetime_on_tooltips_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'Tooltips on .timeago dates', js: true do let(:user) { create(:user) } - let(:project) { create(:empty_project, name: 'test', namespace: user.namespace) } + let(:project) { create(:project, name: 'test', namespace: user.namespace) } let(:created_date) { Date.yesterday.to_time } let(:expected_format) { created_date.in_time_zone.strftime('%b %-d, %Y %l:%M%P') } diff --git a/spec/features/dashboard/issuables_counter_spec.rb b/spec/features/dashboard/issuables_counter_spec.rb index ae68b0f65d5..b431f72fcc9 100644 --- a/spec/features/dashboard/issuables_counter_spec.rb +++ b/spec/features/dashboard/issuables_counter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe 'Navigation bar counter', :use_clean_rails_memory_store_caching do let(:user) { create(:user) } - let(:project) { create(:empty_project, namespace: user.namespace) } + let(:project) { create(:project, namespace: user.namespace) } let(:issue) { create(:issue, project: project) } let(:merge_request) { create(:merge_request, source_project: project) } diff --git a/spec/features/dashboard/issues_filter_spec.rb b/spec/features/dashboard/issues_filter_spec.rb index 0ce642f32f2..facb67ae787 100644 --- a/spec/features/dashboard/issues_filter_spec.rb +++ b/spec/features/dashboard/issues_filter_spec.rb @@ -4,7 +4,7 @@ feature 'Dashboard Issues filtering', :js do include SortingHelper let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:milestone) { create(:milestone, project: project) } let!(:issue) { create(:issue, project: project, author: user, assignees: [user]) } diff --git a/spec/features/dashboard/issues_spec.rb b/spec/features/dashboard/issues_spec.rb index 82adde6258f..be6f78ee607 100644 --- a/spec/features/dashboard/issues_spec.rb +++ b/spec/features/dashboard/issues_spec.rb @@ -3,9 +3,9 @@ require 'spec_helper' RSpec.describe 'Dashboard Issues' do let(:current_user) { create :user } let(:user) { current_user } # Shared examples depend on this being available - let!(:public_project) { create(:empty_project, :public) } - let(:project) { create(:empty_project) } - let(:project_with_issues_disabled) { create(:empty_project, :issues_disabled) } + let!(:public_project) { create(:project, :public) } + let(:project) { create(:project) } + let(:project_with_issues_disabled) { create(:project, :issues_disabled) } let!(:authored_issue) { create :issue, author: current_user, project: project } let!(:authored_issue_on_public_project) { create :issue, author: current_user, project: public_project } let!(:assigned_issue) { create :issue, assignees: [current_user], project: project } diff --git a/spec/features/dashboard/label_filter_spec.rb b/spec/features/dashboard/label_filter_spec.rb index 8e19fb93665..b1a207682c3 100644 --- a/spec/features/dashboard/label_filter_spec.rb +++ b/spec/features/dashboard/label_filter_spec.rb @@ -2,8 +2,8 @@ require 'spec_helper' describe 'Dashboard > label filter', js: true do let(:user) { create(:user) } - let(:project) { create(:empty_project, name: 'test', namespace: user.namespace) } - let(:project2) { create(:empty_project, name: 'test2', path: 'test2', namespace: user.namespace) } + let(:project) { create(:project, name: 'test', namespace: user.namespace) } + let(:project2) { create(:project, name: 'test2', path: 'test2', namespace: user.namespace) } let(:label) { create(:label, title: 'bug', color: '#ff0000') } let(:label2) { create(:label, title: 'bug') } diff --git a/spec/features/dashboard/merge_requests_spec.rb b/spec/features/dashboard/merge_requests_spec.rb index 42d6fadc0c1..b4992dd54a1 100644 --- a/spec/features/dashboard/merge_requests_spec.rb +++ b/spec/features/dashboard/merge_requests_spec.rb @@ -5,9 +5,9 @@ feature 'Dashboard Merge Requests' do include SortingHelper let(:current_user) { create :user } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } - let(:public_project) { create(:empty_project, :public, :repository) } + let(:public_project) { create(:project, :public, :repository) } let(:forked_project) { Projects::ForkService.new(public_project, current_user).execute } before do @@ -16,7 +16,7 @@ feature 'Dashboard Merge Requests' do end context 'new merge request dropdown' do - let(:project_with_disabled_merge_requests) { create(:empty_project, :merge_requests_disabled) } + let(:project_with_disabled_merge_requests) { create(:project, :merge_requests_disabled) } before do project_with_disabled_merge_requests.add_master(current_user) diff --git a/spec/features/dashboard/milestone_filter_spec.rb b/spec/features/dashboard/milestone_filter_spec.rb index 5ebef1eb097..c965b565ca3 100644 --- a/spec/features/dashboard/milestone_filter_spec.rb +++ b/spec/features/dashboard/milestone_filter_spec.rb @@ -4,7 +4,7 @@ feature 'Dashboard > milestone filter', :js do include FilterItemSelectHelper let(:user) { create(:user) } - let(:project) { create(:empty_project, name: 'test', namespace: user.namespace) } + let(:project) { create(:project, name: 'test', namespace: user.namespace) } let(:milestone) { create(:milestone, title: 'v1.0', project: project) } let(:milestone2) { create(:milestone, title: 'v2.0', project: project) } let!(:issue) { create :issue, author: user, project: project, milestone: milestone } diff --git a/spec/features/dashboard/milestone_tabs_spec.rb b/spec/features/dashboard/milestone_tabs_spec.rb index cf32d705365..6fcde35f541 100644 --- a/spec/features/dashboard/milestone_tabs_spec.rb +++ b/spec/features/dashboard/milestone_tabs_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe 'Dashboard milestone tabs', :js do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let!(:label) { create(:label, project: project) } let(:project_milestone) { create(:milestone, project: project) } let(:milestone) do diff --git a/spec/features/dashboard/milestones_spec.rb b/spec/features/dashboard/milestones_spec.rb index 488f7397c69..41d37376cfb 100644 --- a/spec/features/dashboard/milestones_spec.rb +++ b/spec/features/dashboard/milestones_spec.rb @@ -13,7 +13,7 @@ feature 'Dashboard > Milestones' do describe 'as logged-in user' do let(:user) { create(:user) } - let(:project) { create(:empty_project, namespace: user.namespace) } + let(:project) { create(:project, namespace: user.namespace) } let!(:milestone) { create(:milestone, project: project) } before do project.team << [user, :master] diff --git a/spec/features/dashboard/project_member_activity_index_spec.rb b/spec/features/dashboard/project_member_activity_index_spec.rb index f3b538e490e..4a004107408 100644 --- a/spec/features/dashboard/project_member_activity_index_spec.rb +++ b/spec/features/dashboard/project_member_activity_index_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'Project member activity', js: true do let(:user) { create(:user) } - let(:project) { create(:empty_project, :public, name: 'x', namespace: user.namespace) } + let(:project) { create(:project, :public, name: 'x', namespace: user.namespace) } before do project.team << [user, :master] diff --git a/spec/features/dashboard/projects_spec.rb b/spec/features/dashboard/projects_spec.rb index 29ac96adc0e..06a43909053 100644 --- a/spec/features/dashboard/projects_spec.rb +++ b/spec/features/dashboard/projects_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' feature 'Dashboard Projects' do let(:user) { create(:user) } let(:project) { create(:project, :repository, name: 'awesome stuff') } - let(:project2) { create(:empty_project, :public, name: 'Community project') } + let(:project2) { create(:project, :public, name: 'Community project') } before do project.team << [user, :developer] diff --git a/spec/features/dashboard/snippets_spec.rb b/spec/features/dashboard/snippets_spec.rb index c29bcc7c9e9..fb4263d74c4 100644 --- a/spec/features/dashboard/snippets_spec.rb +++ b/spec/features/dashboard/snippets_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe 'Dashboard snippets' do context 'when the project has snippets' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let!(:snippets) { create_list(:project_snippet, 2, :public, author: project.owner, project: project) } before do allow(Snippet).to receive(:default_per_page).and_return(1) diff --git a/spec/features/dashboard/todos/target_state_spec.rb b/spec/features/dashboard/todos/target_state_spec.rb index 93da36c08fc..030a86d1c01 100644 --- a/spec/features/dashboard/todos/target_state_spec.rb +++ b/spec/features/dashboard/todos/target_state_spec.rb @@ -3,7 +3,7 @@ require 'rails_helper' feature 'Dashboard > Todo target states' do let(:user) { create(:user) } let(:author) { create(:user) } - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } before do sign_in(user) diff --git a/spec/features/dashboard/todos/todos_filtering_spec.rb b/spec/features/dashboard/todos/todos_filtering_spec.rb index 0a363259fe7..54d477f7274 100644 --- a/spec/features/dashboard/todos/todos_filtering_spec.rb +++ b/spec/features/dashboard/todos/todos_filtering_spec.rb @@ -4,8 +4,8 @@ feature 'Dashboard > User filters todos', js: true do let(:user_1) { create(:user, username: 'user_1', name: 'user_1') } let(:user_2) { create(:user, username: 'user_2', name: 'user_2') } - let(:project_1) { create(:empty_project, name: 'project_1') } - let(:project_2) { create(:empty_project, name: 'project_2') } + let(:project_1) { create(:project, name: 'project_1') } + let(:project_2) { create(:project, name: 'project_2') } let(:issue) { create(:issue, title: 'issue', project: project_1) } diff --git a/spec/features/dashboard/todos/todos_sorting_spec.rb b/spec/features/dashboard/todos/todos_sorting_spec.rb index d49a78b290f..b7d39a872b0 100644 --- a/spec/features/dashboard/todos/todos_sorting_spec.rb +++ b/spec/features/dashboard/todos/todos_sorting_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'Dashboard > User sorts todos' do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:label_1) { create(:label, title: 'label_1', project: project, priority: 1) } let(:label_2) { create(:label, title: 'label_2', project: project, priority: 2) } diff --git a/spec/features/dashboard/todos/todos_spec.rb b/spec/features/dashboard/todos/todos_spec.rb index c2a61cf5aff..30bab7eeaa7 100644 --- a/spec/features/dashboard/todos/todos_spec.rb +++ b/spec/features/dashboard/todos/todos_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' feature 'Dashboard Todos' do let(:user) { create(:user) } let(:author) { create(:user) } - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:issue) { create(:issue, due_date: Date.today) } context 'User does not have todos' do @@ -212,7 +212,7 @@ feature 'Dashboard Todos' do note1 = create(:note_on_issue, note: "Hello #{label1.to_reference(format: :name)}", noteable_id: issue.id, noteable_type: 'Issue', project: issue.project) create(:todo, :mentioned, project: project, target: issue, user: user, note_id: note1.id) - project2 = create(:empty_project, :public) + project2 = create(:project, :public) label2 = create(:label, project: project2) issue2 = create(:issue, project: project2) note2 = create(:note_on_issue, note: "Test #{label2.to_reference(format: :name)}", noteable_id: issue2.id, noteable_type: 'Issue', project: project2) diff --git a/spec/features/dashboard/user_filters_projects_spec.rb b/spec/features/dashboard/user_filters_projects_spec.rb index a88fe207e0e..c352b6ded14 100644 --- a/spec/features/dashboard/user_filters_projects_spec.rb +++ b/spec/features/dashboard/user_filters_projects_spec.rb @@ -2,9 +2,9 @@ require 'spec_helper' describe 'Dashboard > User filters projects' do let(:user) { create(:user) } - let(:project) { create(:empty_project, name: 'Victorialand', namespace: user.namespace) } + let(:project) { create(:project, name: 'Victorialand', namespace: user.namespace) } let(:user2) { create(:user) } - let(:project2) { create(:empty_project, name: 'Treasure', namespace: user2.namespace) } + let(:project2) { create(:project, name: 'Treasure', namespace: user2.namespace) } before do project.team << [user, :master] diff --git a/spec/features/discussion_comments/issue_spec.rb b/spec/features/discussion_comments/issue_spec.rb index f52ba9c4d09..9812eaf3420 100644 --- a/spec/features/discussion_comments/issue_spec.rb +++ b/spec/features/discussion_comments/issue_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe 'Discussion Comments Issue', :js do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:issue) { create(:issue, project: project) } before do diff --git a/spec/features/discussion_comments/snippets_spec.rb b/spec/features/discussion_comments/snippets_spec.rb index 50ba13499d9..1e6389d9a13 100644 --- a/spec/features/discussion_comments/snippets_spec.rb +++ b/spec/features/discussion_comments/snippets_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe 'Discussion Comments Issue', :js do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:snippet) { create(:project_snippet, :private, project: project, author: user) } before do diff --git a/spec/features/explore/groups_list_spec.rb b/spec/features/explore/groups_list_spec.rb index 84f41eca999..b5325301968 100644 --- a/spec/features/explore/groups_list_spec.rb +++ b/spec/features/explore/groups_list_spec.rb @@ -5,7 +5,7 @@ describe 'Explore Groups page', :js do let!(:group) { create(:group) } let!(:public_group) { create(:group, :public) } let!(:private_group) { create(:group, :private) } - let!(:empty_project) { create(:empty_project, group: public_group) } + let!(:empty_project) { create(:project, group: public_group) } before do group.add_owner(user) diff --git a/spec/features/explore/new_menu_spec.rb b/spec/features/explore/new_menu_spec.rb index b1ccf80c28e..2cd06258e22 100644 --- a/spec/features/explore/new_menu_spec.rb +++ b/spec/features/explore/new_menu_spec.rb @@ -4,7 +4,7 @@ feature 'Top Plus Menu', :js do let(:user) { create(:user) } let(:group) { create(:group) } let(:project) { create(:project, :repository, creator: user, namespace: user.namespace) } - let(:public_project) { create(:empty_project, :public) } + let(:public_project) { create(:project, :public) } before do group.add_owner(user) diff --git a/spec/features/gitlab_flavored_markdown_spec.rb b/spec/features/gitlab_flavored_markdown_spec.rb index 300296a2b94..53b3bb3b65f 100644 --- a/spec/features/gitlab_flavored_markdown_spec.rb +++ b/spec/features/gitlab_flavored_markdown_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe "GitLab Flavored Markdown" do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:issue) { create(:issue, project: project) } let(:fred) do create(:user, name: 'fred') do |user| diff --git a/spec/features/global_search_spec.rb b/spec/features/global_search_spec.rb index 627a930c997..f04e13adba7 100644 --- a/spec/features/global_search_spec.rb +++ b/spec/features/global_search_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'Global search' do let(:user) { create(:user) } - let(:project) { create(:empty_project, namespace: user.namespace) } + let(:project) { create(:project, namespace: user.namespace) } before do project.team << [user, :master] diff --git a/spec/features/groups/empty_states_spec.rb b/spec/features/groups/empty_states_spec.rb index e2c7907528b..7f28553c44e 100644 --- a/spec/features/groups/empty_states_spec.rb +++ b/spec/features/groups/empty_states_spec.rb @@ -9,7 +9,7 @@ feature 'Groups Merge Requests Empty States' do end context 'group has a project' do - let(:project) { create(:empty_project, namespace: group) } + let(:project) { create(:project, namespace: group) } before do project.add_master(user) diff --git a/spec/features/groups/group_settings_spec.rb b/spec/features/groups/group_settings_spec.rb index 121df1ec635..acb21eab03f 100644 --- a/spec/features/groups/group_settings_spec.rb +++ b/spec/features/groups/group_settings_spec.rb @@ -49,7 +49,7 @@ feature 'Edit group settings' do end context 'with a project' do - given!(:project) { create(:empty_project, group: group) } + given!(:project) { create(:project, group: group) } given(:old_project_full_path) { "/#{group.path}/#{project.path}" } given(:new_project_full_path) { "/#{new_group_path}/#{project.path}" } diff --git a/spec/features/groups/members/request_access_spec.rb b/spec/features/groups/members/request_access_spec.rb index 6141981023c..1f3c7fd3859 100644 --- a/spec/features/groups/members/request_access_spec.rb +++ b/spec/features/groups/members/request_access_spec.rb @@ -4,7 +4,7 @@ feature 'Groups > Members > Request access' do let(:user) { create(:user) } let(:owner) { create(:user) } let(:group) { create(:group, :public, :access_requestable) } - let!(:project) { create(:empty_project, :private, namespace: group) } + let!(:project) { create(:project, :private, namespace: group) } background do group.add_owner(owner) diff --git a/spec/features/issuables/close_reopen_report_toggle_spec.rb b/spec/features/issuables/close_reopen_report_toggle_spec.rb index 0e43eed8699..3df77a104e8 100644 --- a/spec/features/issuables/close_reopen_report_toggle_spec.rb +++ b/spec/features/issuables/close_reopen_report_toggle_spec.rb @@ -42,7 +42,7 @@ describe 'Issuables Close/Reopen/Report toggle' do end context 'on an issue' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:issuable) { create(:issue, project: project) } before do @@ -59,7 +59,7 @@ describe 'Issuables Close/Reopen/Report toggle' do end context 'when user doesnt have permission to update' do - let(:cant_project) { create(:empty_project) } + let(:cant_project) { create(:project) } let(:cant_issuable) { create(:issue, project: cant_project) } before do diff --git a/spec/features/issuables/default_sort_order_spec.rb b/spec/features/issuables/default_sort_order_spec.rb index 7c20c96528e..b72b690110f 100644 --- a/spec/features/issuables/default_sort_order_spec.rb +++ b/spec/features/issuables/default_sort_order_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe 'Projects > Issuables > Default sort order' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:first_created_issuable) { issuables.order_created_asc.first } let(:last_created_issuable) { issuables.order_created_desc.first } diff --git a/spec/features/issuables/issuable_list_spec.rb b/spec/features/issuables/issuable_list_spec.rb index 557de721222..2f45ef856a5 100644 --- a/spec/features/issuables/issuable_list_spec.rb +++ b/spec/features/issuables/issuable_list_spec.rb @@ -1,7 +1,7 @@ require 'rails_helper' describe 'issuable list' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } issuable_types = [:issue, :merge_request] diff --git a/spec/features/issuables/markdown_references_spec.rb b/spec/features/issuables/markdown_references_spec.rb index 04d38165a15..dd4e10a9886 100644 --- a/spec/features/issuables/markdown_references_spec.rb +++ b/spec/features/issuables/markdown_references_spec.rb @@ -5,7 +5,7 @@ describe 'Markdown References', :js do let(:actual_project) { create(:project, :public, :repository) } let(:merge_request) { create(:merge_request, target_project: actual_project, source_project: actual_project)} let(:issue_actual_project) { create(:issue, project: actual_project) } - let!(:other_project) { create(:empty_project, :public) } + let!(:other_project) { create(:project, :public) } let!(:issue_other_project) { create(:issue, project: other_project) } let(:issues) { [issue_actual_project, issue_other_project] } diff --git a/spec/features/issues/award_emoji_spec.rb b/spec/features/issues/award_emoji_spec.rb index 6cb0bf6fdfd..134e618feac 100644 --- a/spec/features/issues/award_emoji_spec.rb +++ b/spec/features/issues/award_emoji_spec.rb @@ -1,7 +1,7 @@ require 'rails_helper' describe 'Awards Emoji' do - let!(:project) { create(:empty_project, :public) } + let!(:project) { create(:project, :public) } let!(:user) { create(:user) } let(:issue) do create(:issue, diff --git a/spec/features/issues/award_spec.rb b/spec/features/issues/award_spec.rb index 740281c1050..e95eb19f7d1 100644 --- a/spec/features/issues/award_spec.rb +++ b/spec/features/issues/award_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' feature 'Issue awards', js: true do let(:user) { create(:user) } - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:issue) { create(:issue, project: project) } describe 'logged in' do diff --git a/spec/features/issues/bulk_assignment_labels_spec.rb b/spec/features/issues/bulk_assignment_labels_spec.rb index 5acf8fdae84..847e3856ba5 100644 --- a/spec/features/issues/bulk_assignment_labels_spec.rb +++ b/spec/features/issues/bulk_assignment_labels_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' feature 'Issues > Labels bulk assignment' do let(:user) { create(:user) } - let!(:project) { create(:empty_project) } + let!(:project) { create(:project) } let!(:issue1) { create(:issue, project: project, title: "Issue 1") } let!(:issue2) { create(:issue, project: project, title: "Issue 2") } let!(:bug) { create(:label, project: project, title: 'bug') } diff --git a/spec/features/issues/filtered_search/dropdown_assignee_spec.rb b/spec/features/issues/filtered_search/dropdown_assignee_spec.rb index a403d885de0..a69bd8a09b7 100644 --- a/spec/features/issues/filtered_search/dropdown_assignee_spec.rb +++ b/spec/features/issues/filtered_search/dropdown_assignee_spec.rb @@ -3,7 +3,7 @@ require 'rails_helper' describe 'Dropdown assignee', :js do include FilteredSearchHelpers - let!(:project) { create(:empty_project) } + let!(:project) { create(:project) } let!(:user) { create(:user, name: 'administrator', username: 'root') } let!(:user_john) { create(:user, name: 'John', username: 'th0mas') } let!(:user_jacob) { create(:user, name: 'Jacob', username: 'otter32') } diff --git a/spec/features/issues/filtered_search/dropdown_author_spec.rb b/spec/features/issues/filtered_search/dropdown_author_spec.rb index b7d9bbd7e1d..4bbf18e1dbe 100644 --- a/spec/features/issues/filtered_search/dropdown_author_spec.rb +++ b/spec/features/issues/filtered_search/dropdown_author_spec.rb @@ -3,7 +3,7 @@ require 'rails_helper' describe 'Dropdown author', js: true do include FilteredSearchHelpers - let!(:project) { create(:empty_project) } + let!(:project) { create(:project) } let!(:user) { create(:user, name: 'administrator', username: 'root') } let!(:user_john) { create(:user, name: 'John', username: 'th0mas') } let!(:user_jacob) { create(:user, name: 'Jacob', username: 'otter32') } diff --git a/spec/features/issues/filtered_search/dropdown_hint_spec.rb b/spec/features/issues/filtered_search/dropdown_hint_spec.rb index 292fd683271..04d6dea4b8c 100644 --- a/spec/features/issues/filtered_search/dropdown_hint_spec.rb +++ b/spec/features/issues/filtered_search/dropdown_hint_spec.rb @@ -3,7 +3,7 @@ require 'rails_helper' describe 'Dropdown hint', :js do include FilteredSearchHelpers - let!(:project) { create(:empty_project) } + let!(:project) { create(:project) } let!(:user) { create(:user) } let(:filtered_search) { find('.filtered-search') } let(:js_dropdown_hint) { '#js-dropdown-hint' } diff --git a/spec/features/issues/filtered_search/dropdown_label_spec.rb b/spec/features/issues/filtered_search/dropdown_label_spec.rb index e8f005d7752..67eb0ef0119 100644 --- a/spec/features/issues/filtered_search/dropdown_label_spec.rb +++ b/spec/features/issues/filtered_search/dropdown_label_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe 'Dropdown label', js: true do include FilteredSearchHelpers - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } let(:filtered_search) { find('.filtered-search') } let(:js_dropdown_label) { '#js-dropdown-label' } diff --git a/spec/features/issues/filtered_search/dropdown_milestone_spec.rb b/spec/features/issues/filtered_search/dropdown_milestone_spec.rb index ace73f4b1a6..456eb05f241 100644 --- a/spec/features/issues/filtered_search/dropdown_milestone_spec.rb +++ b/spec/features/issues/filtered_search/dropdown_milestone_spec.rb @@ -3,7 +3,7 @@ require 'rails_helper' describe 'Dropdown milestone', :js do include FilteredSearchHelpers - let!(:project) { create(:empty_project) } + let!(:project) { create(:project) } let!(:user) { create(:user) } let!(:milestone) { create(:milestone, title: 'v1.0', project: project) } let!(:uppercase_milestone) { create(:milestone, title: 'CAP_MILESTONE', project: project) } diff --git a/spec/features/issues/filtered_search/filter_issues_spec.rb b/spec/features/issues/filtered_search/filter_issues_spec.rb index 265bcb3a8e5..cd2cbf4bfe7 100644 --- a/spec/features/issues/filtered_search/filter_issues_spec.rb +++ b/spec/features/issues/filtered_search/filter_issues_spec.rb @@ -5,7 +5,7 @@ describe 'Filter issues', js: true do include FilteredSearchHelpers let!(:group) { create(:group) } - let!(:project) { create(:empty_project, group: group) } + let!(:project) { create(:project, group: group) } let!(:user) { create(:user, username: 'joe', name: 'Joe') } let!(:user2) { create(:user, username: 'jane') } let!(:label) { create(:label, project: project) } diff --git a/spec/features/issues/filtered_search/recent_searches_spec.rb b/spec/features/issues/filtered_search/recent_searches_spec.rb index 5842bb22beb..5eeecaeda47 100644 --- a/spec/features/issues/filtered_search/recent_searches_spec.rb +++ b/spec/features/issues/filtered_search/recent_searches_spec.rb @@ -3,8 +3,8 @@ require 'spec_helper' describe 'Recent searches', js: true do include FilteredSearchHelpers - let(:project_1) { create(:empty_project, :public) } - let(:project_2) { create(:empty_project, :public) } + let(:project_1) { create(:project, :public) } + let(:project_2) { create(:project, :public) } let(:project_1_local_storage_key) { "#{project_1.full_path}-issue-recent-searches" } before do diff --git a/spec/features/issues/filtered_search/search_bar_spec.rb b/spec/features/issues/filtered_search/search_bar_spec.rb index 115875d72ce..aa9d0d842de 100644 --- a/spec/features/issues/filtered_search/search_bar_spec.rb +++ b/spec/features/issues/filtered_search/search_bar_spec.rb @@ -3,7 +3,7 @@ require 'rails_helper' describe 'Search bar', js: true do include FilteredSearchHelpers - let!(:project) { create(:empty_project) } + let!(:project) { create(:project) } let!(:user) { create(:user) } let(:filtered_search) { find('.filtered-search') } diff --git a/spec/features/issues/filtered_search/visual_tokens_spec.rb b/spec/features/issues/filtered_search/visual_tokens_spec.rb index d00d0a9c81b..52efe944b69 100644 --- a/spec/features/issues/filtered_search/visual_tokens_spec.rb +++ b/spec/features/issues/filtered_search/visual_tokens_spec.rb @@ -4,7 +4,7 @@ describe 'Visual tokens', js: true do include FilteredSearchHelpers include WaitForRequests - let!(:project) { create(:empty_project) } + let!(:project) { create(:project) } let!(:user) { create(:user, name: 'administrator', username: 'root') } let!(:user_rock) { create(:user, name: 'The Rock', username: 'rock') } let!(:milestone_nine) { create(:milestone, title: '9.0', project: project) } diff --git a/spec/features/issues/form_spec.rb b/spec/features/issues/form_spec.rb index 0ba02ba42ba..4297bfff3d9 100644 --- a/spec/features/issues/form_spec.rb +++ b/spec/features/issues/form_spec.rb @@ -4,7 +4,7 @@ describe 'New/edit issue', :js do include ActionView::Helpers::JavaScriptHelper include FormHelper - let!(:project) { create(:empty_project) } + let!(:project) { create(:project) } let!(:user) { create(:user)} let!(:user2) { create(:user)} let!(:milestone) { create(:milestone, project: project) } @@ -276,7 +276,7 @@ describe 'New/edit issue', :js do describe 'sub-group project' do let(:group) { create(:group) } let(:nested_group_1) { create(:group, parent: group) } - let(:sub_group_project) { create(:empty_project, group: nested_group_1) } + let(:sub_group_project) { create(:project, group: nested_group_1) } before do sub_group_project.add_master(user) diff --git a/spec/features/issues/gfm_autocomplete_spec.rb b/spec/features/issues/gfm_autocomplete_spec.rb index 1b36f16e8b6..b84635c5134 100644 --- a/spec/features/issues/gfm_autocomplete_spec.rb +++ b/spec/features/issues/gfm_autocomplete_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' feature 'GFM autocomplete', js: true do let(:user) { create(:user, name: '💃speciąl someone💃', username: 'someone.special') } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:label) { create(:label, project: project, title: 'special+') } let(:issue) { create(:issue, project: project) } diff --git a/spec/features/issues/group_label_sidebar_spec.rb b/spec/features/issues/group_label_sidebar_spec.rb index a8ac1d605cb..9c10f78f67a 100644 --- a/spec/features/issues/group_label_sidebar_spec.rb +++ b/spec/features/issues/group_label_sidebar_spec.rb @@ -3,7 +3,7 @@ require 'rails_helper' describe 'Group label on issue' do it 'renders link to the project issues page' do group = create(:group) - project = create(:empty_project, :public, namespace: group) + project = create(:project, :public, namespace: group) feature = create(:group_label, group: group, title: 'feature') issue = create(:labeled_issue, project: project, labels: [feature]) label_link = project_issues_path(project, label_name: [feature.name]) diff --git a/spec/features/issues/issue_detail_spec.rb b/spec/features/issues/issue_detail_spec.rb index a7a7e02b59c..28b636f9359 100644 --- a/spec/features/issues/issue_detail_spec.rb +++ b/spec/features/issues/issue_detail_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' feature 'Issue Detail', :js do let(:user) { create(:user) } - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:issue) { create(:issue, project: project, author: user) } context 'when user displays the issue' do diff --git a/spec/features/issues/issue_sidebar_spec.rb b/spec/features/issues/issue_sidebar_spec.rb index 28f93cfd971..8e22441e0e8 100644 --- a/spec/features/issues/issue_sidebar_spec.rb +++ b/spec/features/issues/issue_sidebar_spec.rb @@ -4,7 +4,7 @@ feature 'Issue Sidebar' do include MobileHelpers let(:group) { create(:group, :nested) } - let(:project) { create(:empty_project, :public, namespace: group) } + let(:project) { create(:project, :public, namespace: group) } let(:issue) { create(:issue, project: project) } let!(:user) { create(:user)} let!(:label) { create(:label, project: project, title: 'bug') } diff --git a/spec/features/issues/markdown_toolbar_spec.rb b/spec/features/issues/markdown_toolbar_spec.rb index 0f869970460..8c23fcd483b 100644 --- a/spec/features/issues/markdown_toolbar_spec.rb +++ b/spec/features/issues/markdown_toolbar_spec.rb @@ -1,7 +1,7 @@ require 'rails_helper' feature 'Issue markdown toolbar', js: true do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:issue) { create(:issue, project: project) } let(:user) { create(:user) } diff --git a/spec/features/issues/move_spec.rb b/spec/features/issues/move_spec.rb index 2ab7d1a71b7..494c309c9ea 100644 --- a/spec/features/issues/move_spec.rb +++ b/spec/features/issues/move_spec.rb @@ -25,8 +25,8 @@ feature 'issue move to another project' do context 'user has permission to move issue' do let!(:mr) { create(:merge_request, source_project: old_project) } - let(:new_project) { create(:empty_project) } - let(:new_project_search) { create(:empty_project) } + let(:new_project) { create(:project) } + let(:new_project_search) { create(:project) } let(:text) { "Text with #{mr.to_reference}" } let(:cross_reference) { old_project.to_reference(new_project) } @@ -63,8 +63,8 @@ feature 'issue move to another project' do end context 'user does not have permission to move the issue to a project', js: true do - let!(:private_project) { create(:empty_project, :private) } - let(:another_project) { create(:empty_project) } + let!(:private_project) { create(:project, :private) } + let(:another_project) { create(:project) } background { another_project.team << [user, :guest] } scenario 'browsing projects in projects select' do diff --git a/spec/features/issues/note_polling_spec.rb b/spec/features/issues/note_polling_spec.rb index b524260750e..9f08ecc214b 100644 --- a/spec/features/issues/note_polling_spec.rb +++ b/spec/features/issues/note_polling_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' feature 'Issue notes polling', :js do include NoteInteractionHelpers - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:issue) { create(:issue, project: project) } describe 'creates' do diff --git a/spec/features/issues/notes_on_issues_spec.rb b/spec/features/issues/notes_on_issues_spec.rb index 29c9b99030a..05c93a19253 100644 --- a/spec/features/issues/notes_on_issues_spec.rb +++ b/spec/features/issues/notes_on_issues_spec.rb @@ -35,21 +35,21 @@ describe 'Create notes on issues', :js do context 'mentioning issue on a private project' do it_behaves_like 'notes with reference' do - let(:project) { create(:empty_project, :private) } + let(:project) { create(:project, :private) } let(:mention) { create(:issue, project: project) } end end context 'mentioning issue on an internal project' do it_behaves_like 'notes with reference' do - let(:project) { create(:empty_project, :internal) } + let(:project) { create(:project, :internal) } let(:mention) { create(:issue, project: project) } end end context 'mentioning issue on a public project' do it_behaves_like 'notes with reference' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:mention) { create(:issue, project: project) } end end diff --git a/spec/features/issues/spam_issues_spec.rb b/spec/features/issues/spam_issues_spec.rb index 7a05e8b2ccc..332ce78b138 100644 --- a/spec/features/issues/spam_issues_spec.rb +++ b/spec/features/issues/spam_issues_spec.rb @@ -3,7 +3,7 @@ require 'rails_helper' describe 'New issue', js: true do include StubENV - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:user) { create(:user)} before do diff --git a/spec/features/issues/todo_spec.rb b/spec/features/issues/todo_spec.rb index 2460ae817f9..8405f1cd48d 100644 --- a/spec/features/issues/todo_spec.rb +++ b/spec/features/issues/todo_spec.rb @@ -1,7 +1,7 @@ require 'rails_helper' feature 'Manually create a todo item from issue', js: true do - let!(:project) { create(:empty_project) } + let!(:project) { create(:project) } let!(:issue) { create(:issue, project: project) } let!(:user) { create(:user)} diff --git a/spec/features/issues/update_issues_spec.rb b/spec/features/issues/update_issues_spec.rb index 389151e63f0..5a7c4f54cb6 100644 --- a/spec/features/issues/update_issues_spec.rb +++ b/spec/features/issues/update_issues_spec.rb @@ -1,7 +1,7 @@ require 'rails_helper' feature 'Multiple issue updating from issues#index', :js do - let!(:project) { create(:empty_project) } + let!(:project) { create(:project) } let!(:issue) { create(:issue, project: project) } let!(:user) { create(:user)} diff --git a/spec/features/issues/user_uses_slash_commands_spec.rb b/spec/features/issues/user_uses_slash_commands_spec.rb index d28ad52ff56..4b63cc844f3 100644 --- a/spec/features/issues/user_uses_slash_commands_spec.rb +++ b/spec/features/issues/user_uses_slash_commands_spec.rb @@ -9,7 +9,7 @@ feature 'Issues > User uses quick actions', js: true do describe 'issue-only commands' do let(:user) { create(:user) } - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } before do project.team << [user, :master] diff --git a/spec/features/issues_spec.rb b/spec/features/issues_spec.rb index 722237481ea..489baa4291f 100644 --- a/spec/features/issues_spec.rb +++ b/spec/features/issues_spec.rb @@ -6,7 +6,7 @@ describe 'Issues' do include SortingHelper let(:user) { create(:user) } - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } before do sign_in(user) @@ -367,7 +367,7 @@ describe 'Issues' do end describe 'when I want to reset my incoming email token' do - let(:project1) { create(:empty_project, namespace: user.namespace) } + let(:project1) { create(:project, namespace: user.namespace) } let!(:issue) { create(:issue, project: project1) } before do diff --git a/spec/features/milestone_spec.rb b/spec/features/milestone_spec.rb index 1d05184d6fc..6c9dc67ad74 100644 --- a/spec/features/milestone_spec.rb +++ b/spec/features/milestone_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' feature 'Milestone' do let(:group) { create(:group, :public) } - let(:project) { create(:empty_project, :public, namespace: group) } + let(:project) { create(:project, :public, namespace: group) } let(:user) { create(:user) } before do diff --git a/spec/features/milestones/show_spec.rb b/spec/features/milestones/show_spec.rb index 199a5ba83b3..20303359c46 100644 --- a/spec/features/milestones/show_spec.rb +++ b/spec/features/milestones/show_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' describe 'Milestone show' do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:milestone) { create(:milestone, project: project) } let(:labels) { create_list(:label, 2, project: project) } let(:issue_params) { { project: project, assignees: [user], author: user, milestone: milestone, labels: labels } } diff --git a/spec/features/participants_autocomplete_spec.rb b/spec/features/participants_autocomplete_spec.rb index 81b0a2f541b..a22d548eef3 100644 --- a/spec/features/participants_autocomplete_spec.rb +++ b/spec/features/participants_autocomplete_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' feature 'Member autocomplete', :js do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:user) { create(:user) } let(:author) { create(:user) } let(:note) { create(:note, noteable: noteable, project: noteable.project) } diff --git a/spec/features/profiles/account_spec.rb b/spec/features/profiles/account_spec.rb index 56c1f7ae9c7..9944a6e1ff1 100644 --- a/spec/features/profiles/account_spec.rb +++ b/spec/features/profiles/account_spec.rb @@ -27,7 +27,7 @@ feature 'Profile > Account' do end context 'with a project' do - given!(:project) { create(:empty_project, namespace: user.namespace) } + given!(:project) { create(:project, namespace: user.namespace) } given(:new_project_path) { "/#{new_username}/#{project.path}" } given(:old_project_path) { "/#{user.username}/#{project.path}" } diff --git a/spec/features/profiles/user_visits_notifications_tab_spec.rb b/spec/features/profiles/user_visits_notifications_tab_spec.rb index e98cec79d87..48c1787c8b7 100644 --- a/spec/features/profiles/user_visits_notifications_tab_spec.rb +++ b/spec/features/profiles/user_visits_notifications_tab_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' feature 'User visits the notifications tab', js: true do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } before do diff --git a/spec/features/projects/activity/rss_spec.rb b/spec/features/projects/activity/rss_spec.rb index b054f543dc6..84c2faa2015 100644 --- a/spec/features/projects/activity/rss_spec.rb +++ b/spec/features/projects/activity/rss_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'Project Activity RSS' do let(:user) { create(:user) } - let(:project) { create(:empty_project, visibility_level: Gitlab::VisibilityLevel::PUBLIC) } + let(:project) { create(:project, visibility_level: Gitlab::VisibilityLevel::PUBLIC) } let(:path) { activity_project_path(project) } before do diff --git a/spec/features/projects/artifacts/browse_spec.rb b/spec/features/projects/artifacts/browse_spec.rb index f5f7eba8e40..42b47cb3301 100644 --- a/spec/features/projects/artifacts/browse_spec.rb +++ b/spec/features/projects/artifacts/browse_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' feature 'Browse artifact', :js do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:pipeline) { create(:ci_empty_pipeline, project: project) } let(:job) { create(:ci_build, :artifacts, pipeline: pipeline) } diff --git a/spec/features/projects/artifacts/download_spec.rb b/spec/features/projects/artifacts/download_spec.rb index c1bba8c15c4..f1bdb2812c6 100644 --- a/spec/features/projects/artifacts/download_spec.rb +++ b/spec/features/projects/artifacts/download_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' feature 'Download artifact', :js do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:pipeline) { create(:ci_empty_pipeline, status: :success, project: project) } let(:job) { create(:ci_build, :artifacts, :success, pipeline: pipeline) } diff --git a/spec/features/projects/artifacts/file_spec.rb b/spec/features/projects/artifacts/file_spec.rb index 4c268b876ea..b2be10a7e0c 100644 --- a/spec/features/projects/artifacts/file_spec.rb +++ b/spec/features/projects/artifacts/file_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' feature 'Artifact file', :js do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:pipeline) { create(:ci_empty_pipeline, project: project) } let(:build) { create(:ci_build, :artifacts, pipeline: pipeline) } diff --git a/spec/features/projects/artifacts/raw_spec.rb b/spec/features/projects/artifacts/raw_spec.rb index 128e39e7803..0bec6e9ad31 100644 --- a/spec/features/projects/artifacts/raw_spec.rb +++ b/spec/features/projects/artifacts/raw_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' feature 'Raw artifact', :js do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:pipeline) { create(:ci_empty_pipeline, project: project) } let(:job) { create(:ci_build, :artifacts, pipeline: pipeline) } diff --git a/spec/features/projects/badges/coverage_spec.rb b/spec/features/projects/badges/coverage_spec.rb index 8cf4bfbf978..368a046f741 100644 --- a/spec/features/projects/badges/coverage_spec.rb +++ b/spec/features/projects/badges/coverage_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'test coverage badge' do given!(:user) { create(:user) } - given!(:project) { create(:empty_project, :private) } + given!(:project) { create(:project, :private) } context 'when user has access to view badge' do background do diff --git a/spec/features/projects/developer_views_empty_project_instructions_spec.rb b/spec/features/projects/developer_views_empty_project_instructions_spec.rb index 7145e286229..fe8567ce348 100644 --- a/spec/features/projects/developer_views_empty_project_instructions_spec.rb +++ b/spec/features/projects/developer_views_empty_project_instructions_spec.rb @@ -1,7 +1,7 @@ require 'rails_helper' feature 'Developer views empty project instructions' do - let(:project) { create(:empty_project, :empty_repo) } + let(:project) { create(:project, :empty_repo) } let(:developer) { create(:user) } background do diff --git a/spec/features/projects/edit_spec.rb b/spec/features/projects/edit_spec.rb index 4b5436027f9..d3b1d1f7be3 100644 --- a/spec/features/projects/edit_spec.rb +++ b/spec/features/projects/edit_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' feature 'Project edit', js: true do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } before do project.team << [user, :master] @@ -20,7 +20,7 @@ feature 'Project edit', js: true do end context 'given project with merge_requests_disabled access level' do - let(:project) { create(:empty_project, :merge_requests_disabled) } + let(:project) { create(:project, :merge_requests_disabled) } it 'hides merge requests section' do expect(page).to have_selector('.merge-requests-feature', visible: false) @@ -36,7 +36,7 @@ feature 'Project edit', js: true do end context 'given project with builds_disabled access level' do - let(:project) { create(:empty_project, :builds_disabled) } + let(:project) { create(:project, :builds_disabled) } it 'hides builds select section' do expect(page).to have_selector('.builds-feature', visible: false) diff --git a/spec/features/projects/environments/environment_spec.rb b/spec/features/projects/environments/environment_spec.rb index c6b7e611a5c..56addd64056 100644 --- a/spec/features/projects/environments/environment_spec.rb +++ b/spec/features/projects/environments/environment_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' feature 'Environment' do - given(:project) { create(:empty_project) } + given(:project) { create(:project) } given(:user) { create(:user) } given(:role) { :developer } diff --git a/spec/features/projects/environments/environments_spec.rb b/spec/features/projects/environments/environments_spec.rb index 36cf307fbe2..1c59e57c0a4 100644 --- a/spec/features/projects/environments/environments_spec.rb +++ b/spec/features/projects/environments/environments_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' feature 'Environments page', :js do - given(:project) { create(:empty_project) } + given(:project) { create(:project) } given(:user) { create(:user) } given(:role) { :developer } diff --git a/spec/features/projects/features_visibility_spec.rb b/spec/features/projects/features_visibility_spec.rb index 37fa61d038e..4044202eb6b 100644 --- a/spec/features/projects/features_visibility_spec.rb +++ b/spec/features/projects/features_visibility_spec.rb @@ -249,7 +249,7 @@ describe 'Edit Project Settings' do # Regression spec for https://gitlab.com/gitlab-org/gitlab-ce/issues/24056 describe 'project statistic visibility' do - let!(:project) { create(:empty_project, :private) } + let!(:project) { create(:project, :private) } before do project.team << [member, :guest] diff --git a/spec/features/projects/files/project_owner_sees_link_to_create_license_file_in_empty_project_spec.rb b/spec/features/projects/files/project_owner_sees_link_to_create_license_file_in_empty_project_spec.rb index 1f4b3763b40..7bcab01c739 100644 --- a/spec/features/projects/files/project_owner_sees_link_to_create_license_file_in_empty_project_spec.rb +++ b/spec/features/projects/files/project_owner_sees_link_to_create_license_file_in_empty_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'project owner sees a link to create a license file in empty project', js: true do let(:project_master) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } background do project.team << [project_master, :master] sign_in(project_master) diff --git a/spec/features/projects/gfm_autocomplete_load_spec.rb b/spec/features/projects/gfm_autocomplete_load_spec.rb index b63e5ae46ee..cff3b1f5743 100644 --- a/spec/features/projects/gfm_autocomplete_load_spec.rb +++ b/spec/features/projects/gfm_autocomplete_load_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe 'GFM autocomplete loading', js: true do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } before do sign_in(create(:admin)) diff --git a/spec/features/projects/group_links_spec.rb b/spec/features/projects/group_links_spec.rb index 698baad97ff..5195d027a9f 100644 --- a/spec/features/projects/group_links_spec.rb +++ b/spec/features/projects/group_links_spec.rb @@ -4,7 +4,7 @@ feature 'Project group links', :js do include Select2Helper let(:master) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let!(:group) { create(:group) } background do @@ -35,7 +35,7 @@ feature 'Project group links', :js do context 'nested group project' do let!(:nested_group) { create(:group, parent: group) } let!(:another_group) { create(:group) } - let!(:project) { create(:empty_project, namespace: nested_group) } + let!(:project) { create(:project, namespace: nested_group) } background do group.add_master(master) diff --git a/spec/features/projects/guest_navigation_menu_spec.rb b/spec/features/projects/guest_navigation_menu_spec.rb index 1c5f89fa898..2385e1d9333 100644 --- a/spec/features/projects/guest_navigation_menu_spec.rb +++ b/spec/features/projects/guest_navigation_menu_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe 'Guest navigation menu' do - let(:project) { create(:empty_project, :private, public_builds: false) } + let(:project) { create(:project, :private, public_builds: false) } let(:guest) { create(:user) } before do diff --git a/spec/features/projects/import_export/import_file_spec.rb b/spec/features/projects/import_export/import_file_spec.rb index f924725870b..c0cfb9eafe2 100644 --- a/spec/features/projects/import_export/import_file_spec.rb +++ b/spec/features/projects/import_export/import_file_spec.rb @@ -46,7 +46,7 @@ feature 'Import/Export - project import integration test', js: true do end scenario 'invalid project' do - project = create(:empty_project, namespace: namespace) + project = create(:project, namespace: namespace) visit new_project_path @@ -62,7 +62,7 @@ feature 'Import/Export - project import integration test', js: true do end scenario 'project with no name' do - create(:empty_project, namespace: namespace) + create(:project, namespace: namespace) visit new_project_path diff --git a/spec/features/projects/import_export/namespace_export_file_spec.rb b/spec/features/projects/import_export/namespace_export_file_spec.rb index 3917e72c39e..691b0e1e4ca 100644 --- a/spec/features/projects/import_export/namespace_export_file_spec.rb +++ b/spec/features/projects/import_export/namespace_export_file_spec.rb @@ -4,7 +4,7 @@ feature 'Import/Export - Namespace export file cleanup', js: true do let(:export_path) { "#{Dir.tmpdir}/import_file_spec" } let(:config_hash) { YAML.load_file(Gitlab::ImportExport.config_file).deep_stringify_keys } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } background do allow_any_instance_of(Gitlab::ImportExport).to receive(:storage_path).and_return(export_path) diff --git a/spec/features/projects/issuable_counts_caching_spec.rb b/spec/features/projects/issuable_counts_caching_spec.rb index 703d1cbd327..1804d9dc244 100644 --- a/spec/features/projects/issuable_counts_caching_spec.rb +++ b/spec/features/projects/issuable_counts_caching_spec.rb @@ -4,7 +4,7 @@ describe 'Issuable counts caching', :use_clean_rails_memory_store_caching do let!(:member) { create(:user) } let!(:member_2) { create(:user) } let!(:non_member) { create(:user) } - let!(:project) { create(:empty_project, :public) } + let!(:project) { create(:project, :public) } let!(:open_issue) { create(:issue, project: project) } let!(:confidential_issue) { create(:issue, :confidential, project: project, author: non_member) } let!(:closed_issue) { create(:issue, :closed, project: project) } diff --git a/spec/features/projects/issues/list_spec.rb b/spec/features/projects/issues/list_spec.rb index c2ca62508a4..9fc03f49f5b 100644 --- a/spec/features/projects/issues/list_spec.rb +++ b/spec/features/projects/issues/list_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'Issues List' do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } background do project.team << [user, :developer] diff --git a/spec/features/projects/issues/rss_spec.rb b/spec/features/projects/issues/rss_spec.rb index d274a1760a4..58eeef8c258 100644 --- a/spec/features/projects/issues/rss_spec.rb +++ b/spec/features/projects/issues/rss_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' feature 'Project Issues RSS' do - let(:project) { create(:empty_project, visibility_level: Gitlab::VisibilityLevel::PUBLIC) } + let(:project) { create(:project, visibility_level: Gitlab::VisibilityLevel::PUBLIC) } let(:path) { project_issues_path(project) } before do diff --git a/spec/features/projects/labels/issues_sorted_by_priority_spec.rb b/spec/features/projects/labels/issues_sorted_by_priority_spec.rb index 2b0aead440c..0292a3192d8 100644 --- a/spec/features/projects/labels/issues_sorted_by_priority_spec.rb +++ b/spec/features/projects/labels/issues_sorted_by_priority_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'Issue prioritization' do let(:user) { create(:user) } - let(:project) { create(:empty_project, name: 'test', namespace: user.namespace) } + let(:project) { create(:project, name: 'test', namespace: user.namespace) } # Labels let(:label_1) { create(:label, title: 'label_1', project: project, priority: 1) } diff --git a/spec/features/projects/labels/subscription_spec.rb b/spec/features/projects/labels/subscription_spec.rb index 3115a643d5d..5716d151250 100644 --- a/spec/features/projects/labels/subscription_spec.rb +++ b/spec/features/projects/labels/subscription_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' feature 'Labels subscription' do let(:user) { create(:user) } let(:group) { create(:group) } - let(:project) { create(:empty_project, :public, namespace: group) } + let(:project) { create(:project, :public, namespace: group) } let!(:bug) { create(:label, project: project, title: 'bug') } let!(:feature) { create(:group_label, group: group, title: 'feature') } diff --git a/spec/features/projects/labels/update_prioritization_spec.rb b/spec/features/projects/labels/update_prioritization_spec.rb index 223f94ff9f9..8f85e972027 100644 --- a/spec/features/projects/labels/update_prioritization_spec.rb +++ b/spec/features/projects/labels/update_prioritization_spec.rb @@ -5,7 +5,7 @@ feature 'Prioritize labels' do let(:user) { create(:user) } let(:group) { create(:group) } - let(:project) { create(:empty_project, :public, namespace: group) } + let(:project) { create(:project, :public, namespace: group) } let!(:bug) { create(:label, project: project, title: 'bug') } let!(:wontfix) { create(:label, project: project, title: 'wontfix') } let!(:feature) { create(:group_label, group: group, title: 'feature') } diff --git a/spec/features/projects/members/anonymous_user_sees_members_spec.rb b/spec/features/projects/members/anonymous_user_sees_members_spec.rb index a26e7becdb9..bf0990d675d 100644 --- a/spec/features/projects/members/anonymous_user_sees_members_spec.rb +++ b/spec/features/projects/members/anonymous_user_sees_members_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' feature 'Projects > Members > Anonymous user sees members' do let(:user) { create(:user) } let(:group) { create(:group, :public) } - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } background do project.team << [user, :master] diff --git a/spec/features/projects/members/group_links_spec.rb b/spec/features/projects/members/group_links_spec.rb index acda5808313..1c348b987d4 100644 --- a/spec/features/projects/members/group_links_spec.rb +++ b/spec/features/projects/members/group_links_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' feature 'Projects > Members > Anonymous user sees members', js: true do let(:user) { create(:user) } let(:group) { create(:group, :public) } - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } background do project.team << [user, :master] diff --git a/spec/features/projects/members/group_member_cannot_leave_group_project_spec.rb b/spec/features/projects/members/group_member_cannot_leave_group_project_spec.rb index 1fb5e000239..6b450fa4e45 100644 --- a/spec/features/projects/members/group_member_cannot_leave_group_project_spec.rb +++ b/spec/features/projects/members/group_member_cannot_leave_group_project_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' feature 'Projects > Members > Group member cannot leave group project' do let(:user) { create(:user) } let(:group) { create(:group) } - let(:project) { create(:empty_project, namespace: group) } + let(:project) { create(:project, namespace: group) } background do group.add_developer(user) diff --git a/spec/features/projects/members/group_member_cannot_request_access_to_his_group_project_spec.rb b/spec/features/projects/members/group_member_cannot_request_access_to_his_group_project_spec.rb index 8e3520f9f15..296a80a3c60 100644 --- a/spec/features/projects/members/group_member_cannot_request_access_to_his_group_project_spec.rb +++ b/spec/features/projects/members/group_member_cannot_request_access_to_his_group_project_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' feature 'Projects > Members > Group member cannot request access to his group project' do let(:user) { create(:user) } let(:group) { create(:group) } - let(:project) { create(:empty_project, namespace: group) } + let(:project) { create(:project, namespace: group) } scenario 'owner does not see the request access button' do group.add_owner(user) diff --git a/spec/features/projects/members/group_members_spec.rb b/spec/features/projects/members/group_members_spec.rb index 154f9f4a26c..c140fece41d 100644 --- a/spec/features/projects/members/group_members_spec.rb +++ b/spec/features/projects/members/group_members_spec.rb @@ -4,7 +4,7 @@ feature 'Projects members' do let(:user) { create(:user) } let(:developer) { create(:user) } let(:group) { create(:group, :public, :access_requestable) } - let(:project) { create(:empty_project, :public, :access_requestable, creator: user, group: group) } + let(:project) { create(:project, :public, :access_requestable, creator: user, group: group) } let(:project_invitee) { create(:project_member, project: project, invite_token: '123', invite_email: 'test1@abc.com', user: nil) } let(:group_invitee) { create(:group_member, group: group, invite_token: '123', invite_email: 'test2@abc.com', user: nil) } let(:project_requester) { create(:user) } diff --git a/spec/features/projects/members/group_requester_cannot_request_access_to_project_spec.rb b/spec/features/projects/members/group_requester_cannot_request_access_to_project_spec.rb index 6865d721201..c8988aa63a7 100644 --- a/spec/features/projects/members/group_requester_cannot_request_access_to_project_spec.rb +++ b/spec/features/projects/members/group_requester_cannot_request_access_to_project_spec.rb @@ -4,7 +4,7 @@ feature 'Projects > Members > Group requester cannot request access to project', let(:user) { create(:user) } let(:owner) { create(:user) } let(:group) { create(:group, :public, :access_requestable) } - let(:project) { create(:empty_project, :public, :access_requestable, namespace: group) } + let(:project) { create(:project, :public, :access_requestable, namespace: group) } background do group.add_owner(owner) diff --git a/spec/features/projects/members/list_spec.rb b/spec/features/projects/members/list_spec.rb index f9c54d267b5..237c059e595 100644 --- a/spec/features/projects/members/list_spec.rb +++ b/spec/features/projects/members/list_spec.rb @@ -6,7 +6,7 @@ feature 'Project members list' do let(:user1) { create(:user, name: 'John Doe') } let(:user2) { create(:user, name: 'Mary Jane') } let(:group) { create(:group) } - let(:project) { create(:empty_project, namespace: group) } + let(:project) { create(:project, namespace: group) } background do sign_in(user1) diff --git a/spec/features/projects/members/master_adds_member_with_expiration_date_spec.rb b/spec/features/projects/members/master_adds_member_with_expiration_date_spec.rb index b4381ea373e..cd621b6b3ce 100644 --- a/spec/features/projects/members/master_adds_member_with_expiration_date_spec.rb +++ b/spec/features/projects/members/master_adds_member_with_expiration_date_spec.rb @@ -5,7 +5,7 @@ feature 'Projects > Members > Master adds member with expiration date', js: true include ActiveSupport::Testing::TimeHelpers let(:master) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let!(:new_member) { create(:user) } background do diff --git a/spec/features/projects/members/master_manages_access_requests_spec.rb b/spec/features/projects/members/master_manages_access_requests_spec.rb index 0f96a7cc70d..eb3c8034873 100644 --- a/spec/features/projects/members/master_manages_access_requests_spec.rb +++ b/spec/features/projects/members/master_manages_access_requests_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' feature 'Projects > Members > Master manages access requests' do let(:user) { create(:user) } let(:master) { create(:user) } - let(:project) { create(:empty_project, :public, :access_requestable) } + let(:project) { create(:project, :public, :access_requestable) } background do project.request_access(user) diff --git a/spec/features/projects/members/member_cannot_request_access_to_his_project_spec.rb b/spec/features/projects/members/member_cannot_request_access_to_his_project_spec.rb index 7f39f5b2513..04806f8fd9e 100644 --- a/spec/features/projects/members/member_cannot_request_access_to_his_project_spec.rb +++ b/spec/features/projects/members/member_cannot_request_access_to_his_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'Projects > Members > Member cannot request access to his project' do let(:member) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } background do project.team << [member, :developer] diff --git a/spec/features/projects/members/owner_cannot_leave_project_spec.rb b/spec/features/projects/members/owner_cannot_leave_project_spec.rb index 8b6d0aafcf8..15162d01c44 100644 --- a/spec/features/projects/members/owner_cannot_leave_project_spec.rb +++ b/spec/features/projects/members/owner_cannot_leave_project_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' feature 'Projects > Members > Owner cannot leave project' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } background do sign_in(project.owner) diff --git a/spec/features/projects/members/owner_cannot_request_access_to_his_project_spec.rb b/spec/features/projects/members/owner_cannot_request_access_to_his_project_spec.rb index d838af6d976..c27925c8dc4 100644 --- a/spec/features/projects/members/owner_cannot_request_access_to_his_project_spec.rb +++ b/spec/features/projects/members/owner_cannot_request_access_to_his_project_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' feature 'Projects > Members > Owner cannot request access to his project' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } background do sign_in(project.owner) diff --git a/spec/features/projects/members/sorting_spec.rb b/spec/features/projects/members/sorting_spec.rb index 45c2647e6e2..afa173c59e5 100644 --- a/spec/features/projects/members/sorting_spec.rb +++ b/spec/features/projects/members/sorting_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' feature 'Projects > Members > Sorting' do let(:master) { create(:user, name: 'John Doe') } let(:developer) { create(:user, name: 'Mary Jane', last_sign_in_at: 5.days.ago) } - let(:project) { create(:empty_project, namespace: master.namespace, creator: master) } + let(:project) { create(:project, namespace: master.namespace, creator: master) } background do create(:project_member, :developer, user: developer, project: project, created_at: 3.days.ago) diff --git a/spec/features/projects/milestones/milestone_spec.rb b/spec/features/projects/milestones/milestone_spec.rb index b1c38ecc9ab..30de3e83fbb 100644 --- a/spec/features/projects/milestones/milestone_spec.rb +++ b/spec/features/projects/milestones/milestone_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'Project milestone' do let(:user) { create(:user) } - let(:project) { create(:empty_project, name: 'test', namespace: user.namespace) } + let(:project) { create(:project, name: 'test', namespace: user.namespace) } let(:milestone) { create(:milestone, project: project) } before do diff --git a/spec/features/projects/milestones/milestones_sorting_spec.rb b/spec/features/projects/milestones/milestones_sorting_spec.rb index 4bd1929ac1e..c531b81e04d 100644 --- a/spec/features/projects/milestones/milestones_sorting_spec.rb +++ b/spec/features/projects/milestones/milestones_sorting_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' feature 'Milestones sorting', :js do include SortingHelper let(:user) { create(:user) } - let(:project) { create(:empty_project, name: 'test', namespace: user.namespace) } + let(:project) { create(:project, name: 'test', namespace: user.namespace) } before do # Milestones diff --git a/spec/features/projects/milestones/new_spec.rb b/spec/features/projects/milestones/new_spec.rb index 7cfcccda439..f7900210fe6 100644 --- a/spec/features/projects/milestones/new_spec.rb +++ b/spec/features/projects/milestones/new_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'Creating a new project milestone', :js do let(:user) { create(:user) } - let(:project) { create(:empty_project, name: 'test', namespace: user.namespace) } + let(:project) { create(:project, name: 'test', namespace: user.namespace) } before do login_as(user) diff --git a/spec/features/projects/pages_spec.rb b/spec/features/projects/pages_spec.rb index 42f23ee5dec..013ed6f2e58 100644 --- a/spec/features/projects/pages_spec.rb +++ b/spec/features/projects/pages_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' feature 'Pages' do - given(:project) { create(:empty_project) } + given(:project) { create(:project) } given(:user) { create(:user) } given(:role) { :master } diff --git a/spec/features/projects/pipelines/pipeline_spec.rb b/spec/features/projects/pipelines/pipeline_spec.rb index 0b626749275..acbc5b046e6 100644 --- a/spec/features/projects/pipelines/pipeline_spec.rb +++ b/spec/features/projects/pipelines/pipeline_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe 'Pipeline', :js do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } before do diff --git a/spec/features/projects/pipelines/pipelines_spec.rb b/spec/features/projects/pipelines/pipelines_spec.rb index 59dff22eca3..f7b40cb1820 100644 --- a/spec/features/projects/pipelines/pipelines_spec.rb +++ b/spec/features/projects/pipelines/pipelines_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe 'Pipelines', :js do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } context 'when user is logged in' do let(:user) { create(:user) } diff --git a/spec/features/projects/project_settings_spec.rb b/spec/features/projects/project_settings_spec.rb index 6001bcfff0a..59603310f51 100644 --- a/spec/features/projects/project_settings_spec.rb +++ b/spec/features/projects/project_settings_spec.rb @@ -4,7 +4,7 @@ describe 'Edit Project Settings' do include Select2Helper let(:user) { create(:user) } - let(:project) { create(:empty_project, namespace: user.namespace, path: 'gitlab', name: 'sample') } + let(:project) { create(:project, namespace: user.namespace, path: 'gitlab', name: 'sample') } before do sign_in(user) @@ -86,7 +86,7 @@ describe 'Edit Project Settings' do it 'overrides the redirect' do old_path = project_path(project) rename_project(project, path: 'bar') - new_project = create(:empty_project, namespace: user.namespace, path: 'gitlabhq', name: 'quz') + new_project = create(:project, namespace: user.namespace, path: 'gitlabhq', name: 'quz') visit old_path expect(current_path).to eq(old_path) expect(find('h1.title')).to have_content(new_project.name) @@ -132,7 +132,7 @@ describe 'Edit Project Settings' do it 'overrides the redirect' do old_path = project_path(project) transfer_project(project, group) - new_project = create(:empty_project, namespace: user.namespace, path: 'gitlabhq', name: 'quz') + new_project = create(:project, namespace: user.namespace, path: 'gitlabhq', name: 'quz') visit old_path expect(current_path).to eq(old_path) expect(find('h1.title')).to have_content(new_project.name) diff --git a/spec/features/projects/services/jira_service_spec.rb b/spec/features/projects/services/jira_service_spec.rb index ecaa69c49dd..65e3a487d4b 100644 --- a/spec/features/projects/services/jira_service_spec.rb +++ b/spec/features/projects/services/jira_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'Setup Jira service', :js do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:service) { project.create_jira_service } let(:url) { 'http://jira.example.com' } diff --git a/spec/features/projects/services/mattermost_slash_command_spec.rb b/spec/features/projects/services/mattermost_slash_command_spec.rb index 134d7e5e8b7..95d5e8b14b9 100644 --- a/spec/features/projects/services/mattermost_slash_command_spec.rb +++ b/spec/features/projects/services/mattermost_slash_command_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'Setup Mattermost slash commands', :js do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:service) { project.create_mattermost_slash_commands_service } let(:mattermost_enabled) { true } diff --git a/spec/features/projects/services/slack_service_spec.rb b/spec/features/projects/services/slack_service_spec.rb index 824cae261e0..c10ec5e2987 100644 --- a/spec/features/projects/services/slack_service_spec.rb +++ b/spec/features/projects/services/slack_service_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' feature 'Projects > Slack service > Setup events' do let(:user) { create(:user) } let(:service) { SlackService.new } - let(:project) { create(:empty_project, slack_service: service) } + let(:project) { create(:project, slack_service: service) } background do service.fields diff --git a/spec/features/projects/services/slack_slash_command_spec.rb b/spec/features/projects/services/slack_slash_command_spec.rb index 6002c589fba..a8baf126269 100644 --- a/spec/features/projects/services/slack_slash_command_spec.rb +++ b/spec/features/projects/services/slack_slash_command_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'Slack slash commands' do given(:user) { create(:user) } - given(:project) { create(:empty_project) } + given(:project) { create(:project) } given(:service) { project.create_slack_slash_commands_service } background do diff --git a/spec/features/projects/settings/integration_settings_spec.rb b/spec/features/projects/settings/integration_settings_spec.rb index 1de4918e142..d932c4e4d9a 100644 --- a/spec/features/projects/settings/integration_settings_spec.rb +++ b/spec/features/projects/settings/integration_settings_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' feature 'Integration settings' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } let(:role) { :developer } let(:integrations_path) { project_settings_integrations_path(project) } diff --git a/spec/features/projects/settings/merge_requests_settings_spec.rb b/spec/features/projects/settings/merge_requests_settings_spec.rb index 796e2026905..a011fab2333 100644 --- a/spec/features/projects/settings/merge_requests_settings_spec.rb +++ b/spec/features/projects/settings/merge_requests_settings_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' feature 'Project settings > Merge Requests', :js do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:user) { create(:user) } background do diff --git a/spec/features/projects/settings/pipelines_settings_spec.rb b/spec/features/projects/settings/pipelines_settings_spec.rb index f24d7ff64d0..232d796a200 100644 --- a/spec/features/projects/settings/pipelines_settings_spec.rb +++ b/spec/features/projects/settings/pipelines_settings_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' feature "Pipelines settings" do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } let(:role) { :developer } diff --git a/spec/features/projects/settings/visibility_settings_spec.rb b/spec/features/projects/settings/visibility_settings_spec.rb index 1e705d211ea..1756c7d00fe 100644 --- a/spec/features/projects/settings/visibility_settings_spec.rb +++ b/spec/features/projects/settings/visibility_settings_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'Visibility settings', js: true do let(:user) { create(:user) } - let(:project) { create(:empty_project, namespace: user.namespace, visibility_level: 20) } + let(:project) { create(:project, namespace: user.namespace, visibility_level: 20) } context 'as owner' do before do diff --git a/spec/features/projects/shortcuts_spec.rb b/spec/features/projects/shortcuts_spec.rb index 2c6d0a56311..bf18c444c3d 100644 --- a/spec/features/projects/shortcuts_spec.rb +++ b/spec/features/projects/shortcuts_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' feature 'Project shortcuts' do - let(:project) { create(:empty_project, name: 'Victorialand') } + let(:project) { create(:project, name: 'Victorialand') } let(:user) { create(:user) } describe 'On a project', js: true do diff --git a/spec/features/projects/snippets/create_snippet_spec.rb b/spec/features/projects/snippets/create_snippet_spec.rb index 7f0e7e3116c..3e79dba3f19 100644 --- a/spec/features/projects/snippets/create_snippet_spec.rb +++ b/spec/features/projects/snippets/create_snippet_spec.rb @@ -4,7 +4,7 @@ feature 'Create Snippet', :js do include DropzoneHelper let(:user) { create(:user) } - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } def fill_form fill_in 'project_snippet_title', with: 'My Snippet Title' diff --git a/spec/features/projects/snippets_spec.rb b/spec/features/projects/snippets_spec.rb index 0822684a42c..1cfbbb4cb62 100644 --- a/spec/features/projects/snippets_spec.rb +++ b/spec/features/projects/snippets_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe 'Project snippets', :js do context 'when the project has snippets' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let!(:snippets) { create_list(:project_snippet, 2, :public, author: project.owner, project: project) } let!(:other_snippet) { create(:project_snippet) } diff --git a/spec/features/projects/sub_group_issuables_spec.rb b/spec/features/projects/sub_group_issuables_spec.rb index 262dcc0abff..aaf64d42515 100644 --- a/spec/features/projects/sub_group_issuables_spec.rb +++ b/spec/features/projects/sub_group_issuables_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe 'Subgroup Issuables', :js, :nested_groups do let!(:group) { create(:group, name: 'group') } let!(:subgroup) { create(:group, parent: group, name: 'subgroup') } - let!(:project) { create(:empty_project, namespace: subgroup, name: 'project') } + let!(:project) { create(:project, namespace: subgroup, name: 'project') } let(:user) { create(:user) } before do diff --git a/spec/features/projects/tags/download_buttons_spec.rb b/spec/features/projects/tags/download_buttons_spec.rb index a6c5a486bcc..d38a5b1324b 100644 --- a/spec/features/projects/tags/download_buttons_spec.rb +++ b/spec/features/projects/tags/download_buttons_spec.rb @@ -5,7 +5,7 @@ feature 'Download buttons in tags page' do given(:role) { :developer } given(:status) { 'success' } given(:tag) { 'v1.0.0' } - given(:project) { create(:project) } + given(:project) { create(:project, :repository) } given(:pipeline) do create(:ci_pipeline, diff --git a/spec/features/projects/wiki/markdown_preview_spec.rb b/spec/features/projects/wiki/markdown_preview_spec.rb index 1dc89665020..9a4ccf3c54d 100644 --- a/spec/features/projects/wiki/markdown_preview_spec.rb +++ b/spec/features/projects/wiki/markdown_preview_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'Projects > Wiki > User previews markdown changes', js: true do let(:user) { create(:user) } - let(:project) { create(:empty_project, namespace: user.namespace) } + let(:project) { create(:project, namespace: user.namespace) } let(:wiki_content) do <<-HEREDOC [regular link](regular) diff --git a/spec/features/projects/wiki/shortcuts_spec.rb b/spec/features/projects/wiki/shortcuts_spec.rb index 2c668185666..eaff5f876b6 100644 --- a/spec/features/projects/wiki/shortcuts_spec.rb +++ b/spec/features/projects/wiki/shortcuts_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'Wiki shortcuts', :js do let(:user) { create(:user) } - let(:project) { create(:empty_project, namespace: user.namespace) } + let(:project) { create(:project, namespace: user.namespace) } let(:wiki_page) do WikiPages::CreateService.new(project, user, title: 'home', content: 'Home page').execute end diff --git a/spec/features/projects/wiki/user_creates_wiki_page_spec.rb b/spec/features/projects/wiki/user_creates_wiki_page_spec.rb index 78c619f6301..9d66f482c8d 100644 --- a/spec/features/projects/wiki/user_creates_wiki_page_spec.rb +++ b/spec/features/projects/wiki/user_creates_wiki_page_spec.rb @@ -11,7 +11,7 @@ feature 'Projects > Wiki > User creates wiki page', :js do end context 'in the user namespace' do - let(:project) { create(:empty_project, namespace: user.namespace) } + let(:project) { create(:project, namespace: user.namespace) } context 'when wiki is empty' do before do @@ -157,7 +157,7 @@ feature 'Projects > Wiki > User creates wiki page', :js do end context 'in a group namespace' do - let(:project) { create(:empty_project, namespace: create(:group, :public)) } + let(:project) { create(:project, namespace: create(:group, :public)) } context 'when wiki is empty' do before do diff --git a/spec/features/projects/wiki/user_git_access_wiki_page_spec.rb b/spec/features/projects/wiki/user_git_access_wiki_page_spec.rb index f1e7f5f2be8..9a92622ba2b 100644 --- a/spec/features/projects/wiki/user_git_access_wiki_page_spec.rb +++ b/spec/features/projects/wiki/user_git_access_wiki_page_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe 'Projects > Wiki > User views Git access wiki page' do let(:user) { create(:user) } - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:wiki_page) do WikiPages::CreateService.new( project, diff --git a/spec/features/projects/wiki/user_updates_wiki_page_spec.rb b/spec/features/projects/wiki/user_updates_wiki_page_spec.rb index 8271428582d..e3739a705bf 100644 --- a/spec/features/projects/wiki/user_updates_wiki_page_spec.rb +++ b/spec/features/projects/wiki/user_updates_wiki_page_spec.rb @@ -12,7 +12,7 @@ feature 'Projects > Wiki > User updates wiki page' do end context 'in the user namespace' do - let(:project) { create(:empty_project, namespace: user.namespace) } + let(:project) { create(:project, namespace: user.namespace) } context 'the home page' do scenario 'success when the wiki content is not empty' do @@ -64,7 +64,7 @@ feature 'Projects > Wiki > User updates wiki page' do end context 'in a group namespace' do - let(:project) { create(:empty_project, namespace: create(:group, :public)) } + let(:project) { create(:project, namespace: create(:group, :public)) } scenario 'the home page' do click_link 'Edit' diff --git a/spec/features/projects/wiki/user_views_project_wiki_page_spec.rb b/spec/features/projects/wiki/user_views_project_wiki_page_spec.rb index 4f94ab1a609..92e96f11219 100644 --- a/spec/features/projects/wiki/user_views_project_wiki_page_spec.rb +++ b/spec/features/projects/wiki/user_views_project_wiki_page_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'Projects > Wiki > User views the wiki page' do let(:user) { create(:user) } - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:old_page_version_id) { wiki_page.versions.last.id } let(:wiki_page) do WikiPages::CreateService.new( diff --git a/spec/features/projects/wiki/user_views_wiki_in_project_page_spec.rb b/spec/features/projects/wiki/user_views_wiki_in_project_page_spec.rb index 8d1e6f66039..cf9fe4c1ad1 100644 --- a/spec/features/projects/wiki/user_views_wiki_in_project_page_spec.rb +++ b/spec/features/projects/wiki/user_views_wiki_in_project_page_spec.rb @@ -10,7 +10,7 @@ describe 'Projects > Wiki > User views wiki in project page' do context 'when repository is disabled for project' do let(:project) do - create(:empty_project, + create(:project, :repository_disabled, :merge_requests_disabled, :builds_disabled) diff --git a/spec/features/projects_spec.rb b/spec/features/projects_spec.rb index 3295f7f9174..dbcdac902d5 100644 --- a/spec/features/projects_spec.rb +++ b/spec/features/projects_spec.rb @@ -36,7 +36,7 @@ feature 'Project' do describe 'remove forked relationship', js: true do let(:user) { create(:user) } - let(:project) { create(:empty_project, namespace: user.namespace) } + let(:project) { create(:project, namespace: user.namespace) } before do sign_in user @@ -57,7 +57,7 @@ feature 'Project' do describe 'removal', js: true do let(:user) { create(:user, username: 'test', name: 'test') } - let(:project) { create(:empty_project, namespace: user.namespace, name: 'project1') } + let(:project) { create(:project, namespace: user.namespace, name: 'project1') } before do sign_in(user) @@ -76,7 +76,7 @@ feature 'Project' do describe 'project title' do let(:user) { create(:user) } - let(:project) { create(:empty_project, namespace: user.namespace) } + let(:project) { create(:project, namespace: user.namespace) } before do sign_in(user) @@ -92,8 +92,8 @@ feature 'Project' do describe 'project title' do let(:user) { create(:user) } - let(:project) { create(:empty_project, namespace: user.namespace) } - let(:project2) { create(:empty_project, namespace: user.namespace, path: 'test') } + let(:project) { create(:project, namespace: user.namespace) } + let(:project2) { create(:project, namespace: user.namespace, path: 'test') } let(:issue) { create(:issue, project: project) } context 'on issues page', js: true do diff --git a/spec/features/reportable_note/issue_spec.rb b/spec/features/reportable_note/issue_spec.rb index 9964a32db2e..21e96f6f103 100644 --- a/spec/features/reportable_note/issue_spec.rb +++ b/spec/features/reportable_note/issue_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe 'Reportable note on issue', :js do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:issue) { create(:issue, project: project) } let!(:note) { create(:note_on_issue, noteable: issue, project: project) } diff --git a/spec/features/reportable_note/snippets_spec.rb b/spec/features/reportable_note/snippets_spec.rb index 9a14024684c..f1e48ed46be 100644 --- a/spec/features/reportable_note/snippets_spec.rb +++ b/spec/features/reportable_note/snippets_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe 'Reportable note on snippets', :js do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } before do project.add_master(user) diff --git a/spec/features/runners_spec.rb b/spec/features/runners_spec.rb index 1725b70acf3..cac31c34ad1 100644 --- a/spec/features/runners_spec.rb +++ b/spec/features/runners_spec.rb @@ -9,13 +9,13 @@ describe "Runners" do describe "specific runners" do before do - @project = FactoryGirl.create :empty_project, shared_runners_enabled: false + @project = FactoryGirl.create :project, shared_runners_enabled: false @project.team << [user, :master] - @project2 = FactoryGirl.create :empty_project + @project2 = FactoryGirl.create :project @project2.team << [user, :master] - @project3 = FactoryGirl.create :empty_project + @project3 = FactoryGirl.create :project @project3.team << [user, :developer] @shared_runner = FactoryGirl.create :ci_runner, :shared @@ -70,7 +70,7 @@ describe "Runners" do describe "shared runners" do before do - @project = FactoryGirl.create :empty_project, shared_runners_enabled: false + @project = FactoryGirl.create :project, shared_runners_enabled: false @project.team << [user, :master] visit runners_path(@project) end @@ -87,7 +87,7 @@ describe "Runners" do before do stub_application_setting(shared_runners_text: shared_runners_text) - project = FactoryGirl.create :empty_project, shared_runners_enabled: false + project = FactoryGirl.create :project, shared_runners_enabled: false project.team << [user, :master] visit runners_path(project) end @@ -99,7 +99,7 @@ describe "Runners" do describe "show page" do before do - @project = FactoryGirl.create :empty_project + @project = FactoryGirl.create :project @project.team << [user, :master] @specific_runner = FactoryGirl.create :ci_runner @project.runners << @specific_runner @@ -113,7 +113,7 @@ describe "Runners" do end feature 'configuring runners ability to picking untagged jobs' do - given(:project) { create(:empty_project) } + given(:project) { create(:project) } given(:runner) { create(:ci_runner) } background do diff --git a/spec/features/search_spec.rb b/spec/features/search_spec.rb index b29f19f1562..9b49fc2225d 100644 --- a/spec/features/search_spec.rb +++ b/spec/features/search_spec.rb @@ -4,7 +4,7 @@ describe "Search" do include FilteredSearchHelpers let(:user) { create(:user) } - let(:project) { create(:empty_project, namespace: user.namespace) } + let(:project) { create(:project, namespace: user.namespace) } let!(:issue) { create(:issue, project: project, assignees: [user]) } let!(:issue2) { create(:issue, project: project, author: user) } @@ -20,7 +20,7 @@ describe "Search" do context 'search filters', js: true do let(:group) { create(:group) } - let!(:group_project) { create(:empty_project, group: group) } + let!(:group_project) { create(:project, group: group) } before do group.add_owner(user) diff --git a/spec/features/security/group/internal_access_spec.rb b/spec/features/security/group/internal_access_spec.rb index bf7be33013e..5067f0b0a49 100644 --- a/spec/features/security/group/internal_access_spec.rb +++ b/spec/features/security/group/internal_access_spec.rb @@ -4,7 +4,7 @@ describe 'Internal Group access' do include AccessMatchers let(:group) { create(:group, :internal) } - let(:project) { create(:empty_project, :internal, group: group) } + let(:project) { create(:project, :internal, group: group) } let(:project_guest) do create(:user) do |user| project.add_guest(user) diff --git a/spec/features/security/group/private_access_spec.rb b/spec/features/security/group/private_access_spec.rb index c399d7a0851..ff32413dc7e 100644 --- a/spec/features/security/group/private_access_spec.rb +++ b/spec/features/security/group/private_access_spec.rb @@ -4,7 +4,7 @@ describe 'Private Group access' do include AccessMatchers let(:group) { create(:group, :private) } - let(:project) { create(:empty_project, :private, group: group) } + let(:project) { create(:project, :private, group: group) } let(:project_guest) do create(:user) do |user| project.add_guest(user) diff --git a/spec/features/security/group/public_access_spec.rb b/spec/features/security/group/public_access_spec.rb index 63e4d7ca65c..16d114fb3f7 100644 --- a/spec/features/security/group/public_access_spec.rb +++ b/spec/features/security/group/public_access_spec.rb @@ -4,7 +4,7 @@ describe 'Public Group access' do include AccessMatchers let(:group) { create(:group, :public) } - let(:project) { create(:empty_project, :public, group: group) } + let(:project) { create(:project, :public, group: group) } let(:project_guest) do create(:user) do |user| project.add_guest(user) diff --git a/spec/features/security/project/snippet/internal_access_spec.rb b/spec/features/security/project/snippet/internal_access_spec.rb index 178782af56c..d7dc99c0a57 100644 --- a/spec/features/security/project/snippet/internal_access_spec.rb +++ b/spec/features/security/project/snippet/internal_access_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe "Internal Project Snippets Access" do include AccessMatchers - let(:project) { create(:empty_project, :internal) } + let(:project) { create(:project, :internal) } let(:internal_snippet) { create(:project_snippet, :internal, project: project, author: project.owner) } let(:private_snippet) { create(:project_snippet, :private, project: project, author: project.owner) } diff --git a/spec/features/security/project/snippet/private_access_spec.rb b/spec/features/security/project/snippet/private_access_spec.rb index 7725c25ca1f..3ec1a388185 100644 --- a/spec/features/security/project/snippet/private_access_spec.rb +++ b/spec/features/security/project/snippet/private_access_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe "Private Project Snippets Access" do include AccessMatchers - let(:project) { create(:empty_project, :private) } + let(:project) { create(:project, :private) } let(:private_snippet) { create(:project_snippet, :private, project: project, author: project.owner) } diff --git a/spec/features/security/project/snippet/public_access_spec.rb b/spec/features/security/project/snippet/public_access_spec.rb index 52aec75dcd0..39b104bfe27 100644 --- a/spec/features/security/project/snippet/public_access_spec.rb +++ b/spec/features/security/project/snippet/public_access_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe "Public Project Snippets Access" do include AccessMatchers - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:public_snippet) { create(:project_snippet, :public, project: project, author: project.owner) } let(:internal_snippet) { create(:project_snippet, :internal, project: project, author: project.owner) } diff --git a/spec/features/snippets_spec.rb b/spec/features/snippets_spec.rb index ae3b876f87c..96c50f6c804 100644 --- a/spec/features/snippets_spec.rb +++ b/spec/features/snippets_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe 'Snippets' do context 'when the project has snippets' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let!(:snippets) { create_list(:project_snippet, 2, :public, author: project.owner, project: project) } before do allow(Snippet).to receive(:default_per_page).and_return(1) diff --git a/spec/features/tags/master_creates_tag_spec.rb b/spec/features/tags/master_creates_tag_spec.rb index 35e1ca32f67..39d79a3327b 100644 --- a/spec/features/tags/master_creates_tag_spec.rb +++ b/spec/features/tags/master_creates_tag_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'Master creates tag' do let(:user) { create(:user) } - let(:project) { create(:project, namespace: user.namespace) } + let(:project) { create(:project, :repository, namespace: user.namespace) } before do project.team << [user, :master] diff --git a/spec/features/tags/master_deletes_tag_spec.rb b/spec/features/tags/master_deletes_tag_spec.rb index e3c904ef3aa..4d6fc13557f 100644 --- a/spec/features/tags/master_deletes_tag_spec.rb +++ b/spec/features/tags/master_deletes_tag_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'Master deletes tag' do let(:user) { create(:user) } - let(:project) { create(:project, namespace: user.namespace) } + let(:project) { create(:project, :repository, namespace: user.namespace) } before do project.team << [user, :master] diff --git a/spec/features/tags/master_updates_tag_spec.rb b/spec/features/tags/master_updates_tag_spec.rb index d6e84a1c685..b93ad44dfd3 100644 --- a/spec/features/tags/master_updates_tag_spec.rb +++ b/spec/features/tags/master_updates_tag_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'Master updates tag' do let(:user) { create(:user) } - let(:project) { create(:project, namespace: user.namespace) } + let(:project) { create(:project, :repository, namespace: user.namespace) } before do project.team << [user, :master] diff --git a/spec/features/tags/master_views_tags_spec.rb b/spec/features/tags/master_views_tags_spec.rb index 27936bc7f52..9edc7ced163 100644 --- a/spec/features/tags/master_views_tags_spec.rb +++ b/spec/features/tags/master_views_tags_spec.rb @@ -26,7 +26,7 @@ feature 'Master views tags' do end context 'when project has tags' do - let(:project) { create(:project, namespace: user.namespace) } + let(:project) { create(:project, :repository, namespace: user.namespace) } let(:repository) { project.repository } before do diff --git a/spec/features/task_lists_spec.rb b/spec/features/task_lists_spec.rb index 7e198ce0677..c14826df55a 100644 --- a/spec/features/task_lists_spec.rb +++ b/spec/features/task_lists_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' feature 'Task Lists' do include Warden::Test::Helpers - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } let(:user2) { create(:user) } diff --git a/spec/features/triggers_spec.rb b/spec/features/triggers_spec.rb index 604fe326e96..8d12a492feb 100644 --- a/spec/features/triggers_spec.rb +++ b/spec/features/triggers_spec.rb @@ -9,7 +9,7 @@ feature 'Triggers', js: true do before do sign_in(user) - @project = create(:empty_project) + @project = create(:project) @project.team << [user, :master] @project.team << [user2, :master] @project.team << [guest_user, :guest] diff --git a/spec/features/unsubscribe_links_spec.rb b/spec/features/unsubscribe_links_spec.rb index d728dc59b3f..392d8e3e1c1 100644 --- a/spec/features/unsubscribe_links_spec.rb +++ b/spec/features/unsubscribe_links_spec.rb @@ -5,7 +5,7 @@ describe 'Unsubscribe links' do let(:recipient) { create(:user) } let(:author) { create(:user) } - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:params) { { title: 'A bug!', description: 'Fix it!', assignees: [recipient] } } let(:issue) { Issues::CreateService.new(project, author, params).execute } diff --git a/spec/features/uploads/user_uploads_file_to_note_spec.rb b/spec/features/uploads/user_uploads_file_to_note_spec.rb index 0654923d9a6..53cad623a35 100644 --- a/spec/features/uploads/user_uploads_file_to_note_spec.rb +++ b/spec/features/uploads/user_uploads_file_to_note_spec.rb @@ -4,7 +4,7 @@ feature 'User uploads file to note' do include DropzoneHelper let(:user) { create(:user) } - let(:project) { create(:empty_project, creator: user, namespace: user.namespace) } + let(:project) { create(:project, creator: user, namespace: user.namespace) } let(:issue) { create(:issue, project: project, author: user) } before do diff --git a/spec/features/user_callout_spec.rb b/spec/features/user_callout_spec.rb index 93768aa46df..37d66b618af 100644 --- a/spec/features/user_callout_spec.rb +++ b/spec/features/user_callout_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe 'User Callouts', js: true do let(:user) { create(:user) } let(:another_user) { create(:user) } - let(:project) { create(:empty_project, path: 'gitlab', name: 'sample') } + let(:project) { create(:project, path: 'gitlab', name: 'sample') } before do sign_in(user) diff --git a/spec/features/users/projects_spec.rb b/spec/features/users/projects_spec.rb index b961d2337ed..f079771cee1 100644 --- a/spec/features/users/projects_spec.rb +++ b/spec/features/users/projects_spec.rb @@ -2,8 +2,8 @@ require 'spec_helper' describe 'Projects tab on a user profile', :js do let(:user) { create(:user) } - let!(:project) { create(:empty_project, namespace: user.namespace) } - let!(:project2) { create(:empty_project, namespace: user.namespace) } + let!(:project) { create(:project, namespace: user.namespace) } + let!(:project2) { create(:project, namespace: user.namespace) } before do allow(Project).to receive(:default_per_page).and_return(1) diff --git a/spec/features/variables_spec.rb b/spec/features/variables_spec.rb index dd770fe5043..6794bf4f4ba 100644 --- a/spec/features/variables_spec.rb +++ b/spec/features/variables_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe 'Project variables', js: true do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:variable) { create(:ci_variable, key: 'test_key', value: 'test value') } before do diff --git a/spec/finders/access_requests_finder_spec.rb b/spec/finders/access_requests_finder_spec.rb index 1d0c15392b2..0789d3a9b44 100644 --- a/spec/finders/access_requests_finder_spec.rb +++ b/spec/finders/access_requests_finder_spec.rb @@ -5,7 +5,7 @@ describe AccessRequestsFinder do let(:access_requester) { create(:user) } let(:project) do - create(:empty_project, :public, :access_requestable) do |project| + create(:project, :public, :access_requestable) do |project| project.request_access(access_requester) end end diff --git a/spec/finders/admin/projects_finder_spec.rb b/spec/finders/admin/projects_finder_spec.rb index 296d6c51d04..4e367d39cf3 100644 --- a/spec/finders/admin/projects_finder_spec.rb +++ b/spec/finders/admin/projects_finder_spec.rb @@ -6,19 +6,19 @@ describe Admin::ProjectsFinder do let(:group) { create(:group, :public) } let!(:private_project) do - create(:empty_project, :private, name: 'A', path: 'A') + create(:project, :private, name: 'A', path: 'A') end let!(:internal_project) do - create(:empty_project, :internal, group: group, name: 'B', path: 'B') + create(:project, :internal, group: group, name: 'B', path: 'B') end let!(:public_project) do - create(:empty_project, :public, group: group, name: 'C', path: 'C') + create(:project, :public, group: group, name: 'C', path: 'C') end let!(:shared_project) do - create(:empty_project, :private, name: 'D', path: 'D') + create(:project, :private, name: 'D', path: 'D') end let(:params) { {} } @@ -40,7 +40,7 @@ describe Admin::ProjectsFinder do context 'filter by namespace_id' do let(:namespace) { create(:namespace) } - let!(:project_in_namespace) { create(:empty_project, namespace: namespace) } + let!(:project_in_namespace) { create(:project, namespace: namespace) } let(:params) { { namespace_id: namespace.id } } it { is_expected.to eq([project_in_namespace]) } @@ -99,7 +99,7 @@ describe Admin::ProjectsFinder do end context 'filter by archived' do - let!(:archived_project) { create(:empty_project, :public, :archived, name: 'E', path: 'E') } + let!(:archived_project) { create(:project, :public, :archived, name: 'E', path: 'E') } context 'archived=false' do let(:params) { { archived: false } } @@ -115,7 +115,7 @@ describe Admin::ProjectsFinder do end context 'filter by personal' do - let!(:personal_project) { create(:empty_project, namespace: user.namespace) } + let!(:personal_project) { create(:project, namespace: user.namespace) } let(:params) { { personal: true } } it { is_expected.to eq([personal_project]) } diff --git a/spec/finders/contributed_projects_finder_spec.rb b/spec/finders/contributed_projects_finder_spec.rb index 34f665826b6..2d079ea83b4 100644 --- a/spec/finders/contributed_projects_finder_spec.rb +++ b/spec/finders/contributed_projects_finder_spec.rb @@ -6,8 +6,8 @@ describe ContributedProjectsFinder do let(:finder) { described_class.new(source_user) } - let!(:public_project) { create(:empty_project, :public) } - let!(:private_project) { create(:empty_project, :private) } + let!(:public_project) { create(:project, :public) } + let!(:private_project) { create(:project, :private) } before do private_project.add_master(source_user) diff --git a/spec/finders/events_finder_spec.rb b/spec/finders/events_finder_spec.rb index 30a2bd14f10..18d6c0cfd74 100644 --- a/spec/finders/events_finder_spec.rb +++ b/spec/finders/events_finder_spec.rb @@ -3,8 +3,8 @@ require 'spec_helper' describe EventsFinder do let(:user) { create(:user) } let(:other_user) { create(:user) } - let(:project1) { create(:empty_project, :private, creator_id: user.id, namespace: user.namespace) } - let(:project2) { create(:empty_project, :private, creator_id: user.id, namespace: user.namespace) } + let(:project1) { create(:project, :private, creator_id: user.id, namespace: user.namespace) } + let(:project2) { create(:project, :private, creator_id: user.id, namespace: user.namespace) } let(:closed_issue) { create(:closed_issue, project: project1, author: user) } let(:opened_merge_request) { create(:merge_request, source_project: project2, author: user) } let!(:closed_issue_event) { create(:event, project: project1, author: user, target: closed_issue, action: Event::CLOSED, created_at: Date.new(2016, 12, 30)) } diff --git a/spec/finders/group_projects_finder_spec.rb b/spec/finders/group_projects_finder_spec.rb index 3c7c9bdcd08..c6d257bc479 100644 --- a/spec/finders/group_projects_finder_spec.rb +++ b/spec/finders/group_projects_finder_spec.rb @@ -7,11 +7,11 @@ describe GroupProjectsFinder do let(:finder) { described_class.new(group: group, current_user: current_user, options: options) } - let!(:public_project) { create(:empty_project, :public, group: group, path: '1') } - let!(:private_project) { create(:empty_project, :private, group: group, path: '2') } - let!(:shared_project_1) { create(:empty_project, :public, path: '3') } - let!(:shared_project_2) { create(:empty_project, :private, path: '4') } - let!(:shared_project_3) { create(:empty_project, :internal, path: '5') } + let!(:public_project) { create(:project, :public, group: group, path: '1') } + let!(:private_project) { create(:project, :private, group: group, path: '2') } + let!(:shared_project_1) { create(:project, :public, path: '3') } + let!(:shared_project_2) { create(:project, :private, path: '4') } + let!(:shared_project_3) { create(:project, :internal, path: '5') } before do shared_project_1.project_group_links.create(group_access: Gitlab::Access::MASTER, group: group) diff --git a/spec/finders/groups_finder_spec.rb b/spec/finders/groups_finder_spec.rb index 9e70cccc3c4..abc470788e1 100644 --- a/spec/finders/groups_finder_spec.rb +++ b/spec/finders/groups_finder_spec.rb @@ -80,7 +80,7 @@ describe GroupsFinder do context 'authorized to private project' do context 'project one level deep' do - let!(:subproject) { create(:empty_project, :private, namespace: private_subgroup) } + let!(:subproject) { create(:project, :private, namespace: private_subgroup) } before do subproject.add_guest(user) end @@ -98,7 +98,7 @@ describe GroupsFinder do context 'project two levels deep' do let!(:private_subsubgroup) { create(:group, :private, parent: private_subgroup) } - let!(:subsubproject) { create(:empty_project, :private, namespace: private_subsubgroup) } + let!(:subsubproject) { create(:project, :private, namespace: private_subsubgroup) } before do subsubproject.add_guest(user) end diff --git a/spec/finders/issues_finder_spec.rb b/spec/finders/issues_finder_spec.rb index bef4fd44331..8769a52863c 100644 --- a/spec/finders/issues_finder_spec.rb +++ b/spec/finders/issues_finder_spec.rb @@ -3,8 +3,8 @@ require 'spec_helper' describe IssuesFinder do set(:user) { create(:user) } set(:user2) { create(:user) } - set(:project1) { create(:empty_project) } - set(:project2) { create(:empty_project) } + set(:project1) { create(:project) } + set(:project2) { create(:project) } set(:milestone) { create(:milestone, project: project1) } set(:label) { create(:label, project: project2) } set(:issue1) { create(:issue, author: user, assignees: [user], project: project1, milestone: milestone, title: 'gitlab', created_at: 1.week.ago) } @@ -87,9 +87,9 @@ describe IssuesFinder do context 'filtering by upcoming milestone' do let(:params) { { milestone_title: Milestone::Upcoming.name } } - let(:project_no_upcoming_milestones) { create(:empty_project, :public) } - let(:project_next_1_1) { create(:empty_project, :public) } - let(:project_next_8_8) { create(:empty_project, :public) } + let(:project_no_upcoming_milestones) { create(:project, :public) } + let(:project_next_1_1) { create(:project, :public) } + let(:project_next_8_8) { create(:project, :public) } let(:yesterday) { Date.today - 1.day } let(:tomorrow) { Date.today + 1.day } @@ -121,9 +121,9 @@ describe IssuesFinder do context 'filtering by started milestone' do let(:params) { { milestone_title: Milestone::Started.name } } - let(:project_no_started_milestones) { create(:empty_project, :public) } - let(:project_started_1_and_2) { create(:empty_project, :public) } - let(:project_started_8) { create(:empty_project, :public) } + let(:project_no_started_milestones) { create(:project, :public) } + let(:project_started_1_and_2) { create(:project, :public) } + let(:project_started_8) { create(:project, :public) } let(:yesterday) { Date.today - 1.day } let(:tomorrow) { Date.today + 1.day } @@ -268,7 +268,7 @@ describe IssuesFinder do it 'finds issues user can access due to group' do group = create(:group) - project = create(:empty_project, group: group) + project = create(:project, group: group) issue = create(:issue, project: project) group.add_user(user, :owner) @@ -296,7 +296,7 @@ describe IssuesFinder do let(:scope) { nil } it "doesn't return team-only issues to non team members" do - project = create(:empty_project, :public, :issues_private) + project = create(:project, :public, :issues_private) issue = create(:issue, project: project) expect(issues).not_to include(issue) @@ -315,7 +315,7 @@ describe IssuesFinder do describe '#with_confidentiality_access_check' do let(:guest) { create(:user) } set(:authorized_user) { create(:user) } - set(:project) { create(:empty_project, namespace: authorized_user.namespace) } + set(:project) { create(:project, namespace: authorized_user.namespace) } set(:public_issue) { create(:issue, project: project) } set(:confidential_issue) { create(:issue, project: project, confidential: true) } diff --git a/spec/finders/joined_groups_finder_spec.rb b/spec/finders/joined_groups_finder_spec.rb index 4c389746252..29a47e005a6 100644 --- a/spec/finders/joined_groups_finder_spec.rb +++ b/spec/finders/joined_groups_finder_spec.rb @@ -42,7 +42,7 @@ describe JoinedGroupsFinder do context 'if profile visitor is in one of the private group projects' do before do - project = create(:empty_project, :private, group: private_group, name: 'B', path: 'B') + project = create(:project, :private, group: private_group, name: 'B', path: 'B') project.add_user(profile_visitor, Gitlab::Access::DEVELOPER) end diff --git a/spec/finders/labels_finder_spec.rb b/spec/finders/labels_finder_spec.rb index 95d96354b77..afa2a40ed2a 100644 --- a/spec/finders/labels_finder_spec.rb +++ b/spec/finders/labels_finder_spec.rb @@ -6,11 +6,11 @@ describe LabelsFinder do let(:group_2) { create(:group) } let(:group_3) { create(:group) } - let(:project_1) { create(:empty_project, namespace: group_1) } - let(:project_2) { create(:empty_project, namespace: group_2) } - let(:project_3) { create(:empty_project) } - let(:project_4) { create(:empty_project, :public) } - let(:project_5) { create(:empty_project, namespace: group_1) } + let(:project_1) { create(:project, namespace: group_1) } + let(:project_2) { create(:project, namespace: group_2) } + let(:project_3) { create(:project) } + let(:project_4) { create(:project, :public) } + let(:project_5) { create(:project, namespace: group_1) } let!(:project_label_1) { create(:label, project: project_1, title: 'Label 1') } let!(:project_label_2) { create(:label, project: project_2, title: 'Label 2') } @@ -68,7 +68,7 @@ describe LabelsFinder do context 'as an administrator' do it 'does not return labels from another project' do # Purposefully creating a project with _nothing_ associated to it - isolated_project = create(:empty_project) + isolated_project = create(:project) admin = create(:admin) # project_3 has a label associated to it, which we don't want coming diff --git a/spec/finders/members_finder_spec.rb b/spec/finders/members_finder_spec.rb index 9fb9ffa95e7..300ba8422e8 100644 --- a/spec/finders/members_finder_spec.rb +++ b/spec/finders/members_finder_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe MembersFinder, '#execute' do let(:group) { create(:group) } let(:nested_group) { create(:group, :access_requestable, parent: group) } - let(:project) { create(:empty_project, namespace: nested_group) } + let(:project) { create(:project, namespace: nested_group) } let(:user1) { create(:user) } let(:user2) { create(:user) } let(:user3) { create(:user) } diff --git a/spec/finders/merge_requests_finder_spec.rb b/spec/finders/merge_requests_finder_spec.rb index b46218bf72e..b54155a6704 100644 --- a/spec/finders/merge_requests_finder_spec.rb +++ b/spec/finders/merge_requests_finder_spec.rb @@ -4,9 +4,9 @@ describe MergeRequestsFinder do let(:user) { create :user } let(:user2) { create :user } - let(:project1) { create(:empty_project) } - let(:project2) { create(:empty_project, forked_from_project: project1) } - let(:project3) { create(:empty_project, :archived, forked_from_project: project1) } + let(:project1) { create(:project) } + let(:project2) { create(:project, forked_from_project: project1) } + let(:project3) { create(:project, :archived, forked_from_project: project1) } let!(:merge_request1) { create(:merge_request, :simple, author: user, source_project: project2, target_project: project1) } let!(:merge_request2) { create(:merge_request, :simple, author: user, source_project: project2, target_project: project1, state: 'closed') } @@ -67,7 +67,7 @@ describe MergeRequestsFinder do end context 'with created_after and created_before params' do - let(:project4) { create(:empty_project, forked_from_project: project1) } + let(:project4) { create(:project, forked_from_project: project1) } let!(:new_merge_request) do create(:merge_request, diff --git a/spec/finders/milestones_finder_spec.rb b/spec/finders/milestones_finder_spec.rb index 32ec983c5b8..8ae08656e01 100644 --- a/spec/finders/milestones_finder_spec.rb +++ b/spec/finders/milestones_finder_spec.rb @@ -2,8 +2,8 @@ require 'spec_helper' describe MilestonesFinder do let(:group) { create(:group) } - let(:project_1) { create(:empty_project, namespace: group) } - let(:project_2) { create(:empty_project, namespace: group) } + let(:project_1) { create(:project, namespace: group) } + let(:project_2) { create(:project, namespace: group) } let!(:milestone_1) { create(:milestone, group: group, title: 'one test', due_date: Date.today) } let!(:milestone_2) { create(:milestone, group: group) } let!(:milestone_3) { create(:milestone, project: project_1, state: 'active', due_date: Date.tomorrow) } diff --git a/spec/finders/move_to_project_finder_spec.rb b/spec/finders/move_to_project_finder_spec.rb index dea87980e25..e577083a2d0 100644 --- a/spec/finders/move_to_project_finder_spec.rb +++ b/spec/finders/move_to_project_finder_spec.rb @@ -2,13 +2,13 @@ require 'spec_helper' describe MoveToProjectFinder do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } - let(:no_access_project) { create(:empty_project) } - let(:guest_project) { create(:empty_project) } - let(:reporter_project) { create(:empty_project) } - let(:developer_project) { create(:empty_project) } - let(:master_project) { create(:empty_project) } + let(:no_access_project) { create(:project) } + let(:guest_project) { create(:project) } + let(:reporter_project) { create(:project) } + let(:developer_project) { create(:project) } + let(:master_project) { create(:project) } subject { described_class.new(user) } @@ -37,7 +37,7 @@ describe MoveToProjectFinder do it 'does not return archived projects' do reporter_project.team << [user, :reporter] reporter_project.archive! - other_reporter_project = create(:empty_project) + other_reporter_project = create(:project) other_reporter_project.team << [user, :reporter] expect(subject.execute(project).to_a).to eq([other_reporter_project]) @@ -46,7 +46,7 @@ describe MoveToProjectFinder do it 'does not return projects for which issues are disabled' do reporter_project.team << [user, :reporter] reporter_project.update_attributes(issues_enabled: false) - other_reporter_project = create(:empty_project) + other_reporter_project = create(:project) other_reporter_project.team << [user, :reporter] expect(subject.execute(project).to_a).to eq([other_reporter_project]) @@ -83,10 +83,10 @@ describe MoveToProjectFinder do end it 'returns projects matching a search query' do - foo_project = create(:empty_project) + foo_project = create(:project) foo_project.team << [user, :master] - wadus_project = create(:empty_project, name: 'wadus') + wadus_project = create(:project, name: 'wadus') wadus_project.team << [user, :master] expect(subject.execute(project).to_a).to eq([wadus_project, foo_project]) diff --git a/spec/finders/notes_finder_spec.rb b/spec/finders/notes_finder_spec.rb index ba6bbb3bce0..900fa2b12d1 100644 --- a/spec/finders/notes_finder_spec.rb +++ b/spec/finders/notes_finder_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe NotesFinder do let(:user) { create :user } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } before do project.team << [user, :master] @@ -43,7 +43,7 @@ describe NotesFinder do context 'on restricted projects' do let(:project) do - create(:empty_project, + create(:project, :public, :issues_private, :snippets_private, @@ -156,7 +156,7 @@ describe NotesFinder do end describe '.search' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:note) { create(:note_on_issue, note: 'WoW', project: project) } it 'returns notes with matching content' do diff --git a/spec/finders/personal_projects_finder_spec.rb b/spec/finders/personal_projects_finder_spec.rb index 304b0fb67fb..d0113ba87df 100644 --- a/spec/finders/personal_projects_finder_spec.rb +++ b/spec/finders/personal_projects_finder_spec.rb @@ -4,14 +4,14 @@ describe PersonalProjectsFinder do let(:source_user) { create(:user) } let(:current_user) { create(:user) } let(:finder) { described_class.new(source_user) } - let!(:public_project) { create(:empty_project, :public, namespace: source_user.namespace) } + let!(:public_project) { create(:project, :public, namespace: source_user.namespace) } let!(:private_project) do - create(:empty_project, :private, namespace: source_user.namespace, path: 'mepmep') + create(:project, :private, namespace: source_user.namespace, path: 'mepmep') end let!(:internal_project) do - create(:empty_project, :internal, namespace: source_user.namespace, path: 'C') + create(:project, :internal, namespace: source_user.namespace, path: 'C') end before do diff --git a/spec/finders/pipeline_schedules_finder_spec.rb b/spec/finders/pipeline_schedules_finder_spec.rb index e184a87c9c7..b9538649b3f 100644 --- a/spec/finders/pipeline_schedules_finder_spec.rb +++ b/spec/finders/pipeline_schedules_finder_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe PipelineSchedulesFinder do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let!(:active_schedule) { create(:ci_pipeline_schedule, project: project) } let!(:inactive_schedule) { create(:ci_pipeline_schedule, :inactive, project: project) } diff --git a/spec/finders/projects_finder_spec.rb b/spec/finders/projects_finder_spec.rb index 03d98459e8c..a5de586e869 100644 --- a/spec/finders/projects_finder_spec.rb +++ b/spec/finders/projects_finder_spec.rb @@ -6,19 +6,19 @@ describe ProjectsFinder do let(:group) { create(:group, :public) } let!(:private_project) do - create(:empty_project, :private, name: 'A', path: 'A') + create(:project, :private, name: 'A', path: 'A') end let!(:internal_project) do - create(:empty_project, :internal, group: group, name: 'B', path: 'B') + create(:project, :internal, group: group, name: 'B', path: 'B') end let!(:public_project) do - create(:empty_project, :public, group: group, name: 'C', path: 'C') + create(:project, :public, group: group, name: 'C', path: 'C') end let!(:shared_project) do - create(:empty_project, :private, name: 'D', path: 'D') + create(:project, :private, name: 'D', path: 'D') end let(:params) { {} } @@ -90,7 +90,7 @@ describe ProjectsFinder do end describe 'filter by personal' do - let!(:personal_project) { create(:empty_project, namespace: user.namespace) } + let!(:personal_project) { create(:project, namespace: user.namespace) } let(:params) { { personal: true } } it { is_expected.to eq([personal_project]) } @@ -109,7 +109,7 @@ describe ProjectsFinder do end describe 'filter by archived' do - let!(:archived_project) { create(:empty_project, :public, :archived, name: 'E', path: 'E') } + let!(:archived_project) { create(:project, :public, :archived, name: 'E', path: 'E') } context 'non_archived=true' do let(:params) { { non_archived: true } } @@ -139,7 +139,7 @@ describe ProjectsFinder do describe 'filter by owned' do let(:params) { { owned: true } } - let!(:owned_project) { create(:empty_project, :private, namespace: current_user.namespace) } + let!(:owned_project) { create(:project, :private, namespace: current_user.namespace) } it { is_expected.to eq([owned_project]) } end diff --git a/spec/finders/snippets_finder_spec.rb b/spec/finders/snippets_finder_spec.rb index 35f1683eef9..7ae7b7d2140 100644 --- a/spec/finders/snippets_finder_spec.rb +++ b/spec/finders/snippets_finder_spec.rb @@ -5,8 +5,8 @@ describe SnippetsFinder do let(:user1) { create :user } let(:group) { create :group, :public } - let(:project1) { create(:empty_project, :public, group: group) } - let(:project2) { create(:empty_project, :private, group: group) } + let(:project1) { create(:project, :public, group: group) } + let(:project2) { create(:project, :private, group: group) } context 'all snippets visible to a user' do let!(:snippet1) { create(:personal_snippet, :private) } diff --git a/spec/finders/todos_finder_spec.rb b/spec/finders/todos_finder_spec.rb index 8be447418b0..884ce22091e 100644 --- a/spec/finders/todos_finder_spec.rb +++ b/spec/finders/todos_finder_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe TodosFinder do describe '#execute' do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:finder) { described_class } before do diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index ac5a58ac189..10bc5f2ecd2 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -58,7 +58,7 @@ describe ApplicationHelper do describe 'project_icon' do it 'returns an url for the avatar' do - project = create(:empty_project, avatar: File.open(uploaded_image_temp_path)) + project = create(:project, avatar: File.open(uploaded_image_temp_path)) avatar_url = "/uploads/-/system/project/avatar/#{project.id}/banana_sample.gif" expect(helper.project_icon(project.full_path).to_s) @@ -72,7 +72,7 @@ describe ApplicationHelper do end it 'gives uploaded icon when present' do - project = create(:empty_project) + project = create(:project) allow_any_instance_of(Project).to receive(:avatar_in_git).and_return(true) diff --git a/spec/helpers/blob_helper_spec.rb b/spec/helpers/blob_helper_spec.rb index bd3a3d24b84..c654151564e 100644 --- a/spec/helpers/blob_helper_spec.rb +++ b/spec/helpers/blob_helper_spec.rb @@ -108,7 +108,7 @@ describe BlobHelper do context 'viewer related' do include FakeBlobHelpers - let(:project) { build(:empty_project, lfs_enabled: true) } + let(:project) { build(:project, lfs_enabled: true) } before do allow(Gitlab.config.lfs).to receive(:enabled).and_return(true) diff --git a/spec/helpers/button_helper_spec.rb b/spec/helpers/button_helper_spec.rb index 7c6f3b101d7..250ba239033 100644 --- a/spec/helpers/button_helper_spec.rb +++ b/spec/helpers/button_helper_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe ButtonHelper do describe 'http_clone_button' do let(:user) { create(:user) } - let(:project) { build_stubbed(:empty_project) } + let(:project) { build_stubbed(:project) } let(:has_tooltip_class) { 'has-tooltip' } def element diff --git a/spec/helpers/ci_status_helper_spec.rb b/spec/helpers/ci_status_helper_spec.rb index 3f8df388014..6a3945c0ebc 100644 --- a/spec/helpers/ci_status_helper_spec.rb +++ b/spec/helpers/ci_status_helper_spec.rb @@ -48,7 +48,7 @@ describe CiStatusHelper do describe "#pipeline_status_cache_key" do it "builds a cache key for pipeline status" do pipeline_status = Gitlab::Cache::Ci::ProjectPipelineStatus.new( - build_stubbed(:empty_project), + build_stubbed(:project), pipeline_info: { sha: "123abc", status: "success" diff --git a/spec/helpers/commits_helper_spec.rb b/spec/helpers/commits_helper_spec.rb index c245bb439db..7179185285c 100644 --- a/spec/helpers/commits_helper_spec.rb +++ b/spec/helpers/commits_helper_spec.rb @@ -28,7 +28,7 @@ describe CommitsHelper do end describe '#view_on_environment_button' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:environment) { create(:environment, external_url: 'http://example.com') } let(:path) { 'source/file.html' } let(:sha) { RepoHelpers.sample_commit.id } diff --git a/spec/helpers/events_helper_spec.rb b/spec/helpers/events_helper_spec.rb index c3bd0cb3542..aa138f25bd3 100644 --- a/spec/helpers/events_helper_spec.rb +++ b/spec/helpers/events_helper_spec.rb @@ -72,13 +72,13 @@ describe EventsHelper do end it 'preserves style attribute for a label that can be accessed by current_user' do - project = create(:empty_project, :public) + project = create(:project, :public) expect(format_event_note(project)).to match(/span class=.*style=.*/) end it 'does not style a label that can not be accessed by current_user' do - project = create(:empty_project, :private) + project = create(:project, :private) expect(format_event_note(project)).to eq("<p>#{input}</p>") end diff --git a/spec/helpers/gitlab_routing_helper_spec.rb b/spec/helpers/gitlab_routing_helper_spec.rb index 9aaed0edf87..537e457513f 100644 --- a/spec/helpers/gitlab_routing_helper_spec.rb +++ b/spec/helpers/gitlab_routing_helper_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe GitlabRoutingHelper do - let(:project) { build_stubbed(:empty_project) } + let(:project) { build_stubbed(:project) } let(:group) { build_stubbed(:group) } describe 'Project URL helpers' do diff --git a/spec/helpers/groups_helper_spec.rb b/spec/helpers/groups_helper_spec.rb index 3a246f10283..9d6e03e3868 100644 --- a/spec/helpers/groups_helper_spec.rb +++ b/spec/helpers/groups_helper_spec.rb @@ -23,7 +23,7 @@ describe GroupsHelper do describe 'group_lfs_status' do let(:group) { create(:group) } - let!(:project) { create(:empty_project, namespace_id: group.id) } + let!(:project) { create(:project, namespace_id: group.id) } before do allow(Gitlab.config.lfs).to receive(:enabled).and_return(true) @@ -47,7 +47,7 @@ describe GroupsHelper do context 'more than one project in group' do before do - create(:empty_project, namespace_id: group.id) + create(:project, namespace_id: group.id) end context 'LFS enabled in group' do diff --git a/spec/helpers/hooks_helper_spec.rb b/spec/helpers/hooks_helper_spec.rb index 9f0004bf8cf..2e21f1134b1 100644 --- a/spec/helpers/hooks_helper_spec.rb +++ b/spec/helpers/hooks_helper_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe HooksHelper do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:project_hook) { create(:project_hook, project: project) } let(:system_hook) { create(:system_hook) } let(:trigger) { 'push_events' } diff --git a/spec/helpers/issuables_helper_spec.rb b/spec/helpers/issuables_helper_spec.rb index 1aad8a85ab7..7789cfa3554 100644 --- a/spec/helpers/issuables_helper_spec.rb +++ b/spec/helpers/issuables_helper_spec.rb @@ -180,7 +180,7 @@ describe IssuablesHelper do context 'when show_full_reference falsey' do context 'when @group present' do it 'display issuable reference to @group' do - project = build_stubbed(:empty_project) + project = build_stubbed(:project) assign(:show_full_reference, nil) assign(:group, project.namespace) @@ -193,7 +193,7 @@ describe IssuablesHelper do context 'when @project present' do it 'display issuable reference to @project' do - project = build_stubbed(:empty_project) + project = build_stubbed(:project) assign(:show_full_reference, nil) assign(:group, nil) diff --git a/spec/helpers/issues_helper_spec.rb b/spec/helpers/issues_helper_spec.rb index 9524a101e74..dc3100311f8 100644 --- a/spec/helpers/issues_helper_spec.rb +++ b/spec/helpers/issues_helper_spec.rb @@ -1,7 +1,7 @@ require "spec_helper" describe IssuesHelper do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:issue) { create :issue, project: project } let(:ext_project) { create :redmine_project } diff --git a/spec/helpers/labels_helper_spec.rb b/spec/helpers/labels_helper_spec.rb index 8fc94ce09db..36d6e495ed0 100644 --- a/spec/helpers/labels_helper_spec.rb +++ b/spec/helpers/labels_helper_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe LabelsHelper do describe 'link_to_label' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:label) { create(:label, project: project) } context 'without subject' do @@ -13,7 +13,7 @@ describe LabelsHelper do context 'with a project as subject' do let(:namespace) { build(:namespace, name: 'foo3') } - let(:another_project) { build(:empty_project, namespace: namespace, name: 'bar3') } + let(:another_project) { build(:project, namespace: namespace, name: 'bar3') } it 'links to project issues page' do expect(link_to_label(label, subject: another_project)).to match %r{<a href="/foo3/bar3/issues\?label_name%5B%5D=#{label.name}">.*</a>} diff --git a/spec/helpers/markup_helper_spec.rb b/spec/helpers/markup_helper_spec.rb index 6dfffb7ac63..70eb01c9c44 100644 --- a/spec/helpers/markup_helper_spec.rb +++ b/spec/helpers/markup_helper_spec.rb @@ -42,7 +42,7 @@ describe MarkupHelper do describe "override default project" do let(:actual) { issue.to_reference } - let(:second_project) { create(:empty_project, :public) } + let(:second_project) { create(:project, :public) } let(:second_issue) { create(:issue, project: second_project) } it 'links to the issue' do diff --git a/spec/helpers/members_helper_spec.rb b/spec/helpers/members_helper_spec.rb index 2b455571d52..33186cf50d5 100644 --- a/spec/helpers/members_helper_spec.rb +++ b/spec/helpers/members_helper_spec.rb @@ -11,7 +11,7 @@ describe MembersHelper do describe '#remove_member_message' do let(:requester) { create(:user) } - let(:project) { create(:empty_project, :public, :access_requestable) } + let(:project) { create(:project, :public, :access_requestable) } let(:project_member) { build(:project_member, project: project) } let(:project_member_invite) { build(:project_member, project: project).tap { |m| m.generate_invite_token! } } let(:project_member_request) { project.request_access(requester) } @@ -32,7 +32,7 @@ describe MembersHelper do describe '#remove_member_title' do let(:requester) { create(:user) } - let(:project) { create(:empty_project, :public, :access_requestable) } + let(:project) { create(:project, :public, :access_requestable) } let(:project_member) { build(:project_member, project: project) } let(:project_member_request) { project.request_access(requester) } let(:group) { create(:group, :access_requestable) } @@ -46,7 +46,7 @@ describe MembersHelper do end describe '#leave_confirmation_message' do - let(:project) { build_stubbed(:empty_project) } + let(:project) { build_stubbed(:project) } let(:group) { build_stubbed(:group) } let(:user) { build_stubbed(:user) } diff --git a/spec/helpers/merge_requests_helper_spec.rb b/spec/helpers/merge_requests_helper_spec.rb index b2a9e277a1c..7d1c17909bf 100644 --- a/spec/helpers/merge_requests_helper_spec.rb +++ b/spec/helpers/merge_requests_helper_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe MergeRequestsHelper do describe 'ci_build_details_path' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:merge_request) { MergeRequest.new } let(:ci_service) { CiService.new } let(:last_commit) { Ci::Pipeline.new({}) } @@ -30,8 +30,8 @@ describe MergeRequestsHelper do end describe 'within different projects' do - let(:project) { create(:empty_project) } - let(:fork_project) { create(:empty_project, forked_from_project: project) } + let(:project) { create(:project) } + let(:fork_project) { create(:project, forked_from_project: project) } let(:merge_request) { create(:merge_request, source_project: fork_project, target_project: project) } subject { format_mr_branch_names(merge_request) } let(:source_title) { "#{fork_project.full_path}:#{merge_request.source_branch}" } diff --git a/spec/helpers/milestones_helper_spec.rb b/spec/helpers/milestones_helper_spec.rb index b8f9c02a486..70b4a89cb86 100644 --- a/spec/helpers/milestones_helper_spec.rb +++ b/spec/helpers/milestones_helper_spec.rb @@ -2,8 +2,8 @@ require 'spec_helper' describe MilestonesHelper do describe '#milestones_filter_dropdown_path' do - let(:project) { create(:empty_project) } - let(:project2) { create(:empty_project) } + let(:project) { create(:project) } + let(:project2) { create(:project) } let(:group) { create(:group) } context 'when @project present' do @@ -57,7 +57,7 @@ describe MilestonesHelper do end describe '#milestone_counts' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:counts) { helper.milestone_counts(project.milestones) } context 'when there are milestones' do diff --git a/spec/helpers/notes_helper_spec.rb b/spec/helpers/notes_helper_spec.rb index da1044cef3f..9921ca1af33 100644 --- a/spec/helpers/notes_helper_spec.rb +++ b/spec/helpers/notes_helper_spec.rb @@ -5,7 +5,7 @@ describe NotesHelper do let(:owner) { create(:owner) } let(:group) { create(:group) } - let(:project) { create(:empty_project, namespace: group) } + let(:project) { create(:project, namespace: group) } let(:master) { create(:user) } let(:reporter) { create(:user) } let(:guest) { create(:user) } @@ -30,7 +30,7 @@ describe NotesHelper do end it 'handles access in different projects' do - second_project = create(:empty_project) + second_project = create(:project) second_project.team << [master, :reporter] other_note = create(:note, author: master, project: second_project) @@ -191,7 +191,7 @@ describe NotesHelper do it 'return project notes path for project snippet' do namespace = create(:namespace, path: 'nm') - @project = create(:empty_project, path: 'test', namespace: namespace) + @project = create(:project, path: 'test', namespace: namespace) @snippet = create(:project_snippet, project: @project) @noteable = @snippet @@ -200,7 +200,7 @@ describe NotesHelper do it 'return project notes path for other noteables' do namespace = create(:namespace, path: 'nm') - @project = create(:empty_project, path: 'test', namespace: namespace) + @project = create(:project, path: 'test', namespace: namespace) @noteable = create(:issue, project: @project) expect(helper.notes_url).to eq("/nm/test/noteable/issue/#{@noteable.id}/notes") @@ -216,7 +216,7 @@ describe NotesHelper do it 'return project notes path for project snippet' do namespace = create(:namespace, path: 'nm') - @project = create(:empty_project, path: 'test', namespace: namespace) + @project = create(:project, path: 'test', namespace: namespace) note = create(:note_on_project_snippet, project: @project) expect(helper.note_url(note)).to eq("/nm/test/notes/#{note.id}") @@ -224,7 +224,7 @@ describe NotesHelper do it 'return project notes path for other noteables' do namespace = create(:namespace, path: 'nm') - @project = create(:empty_project, path: 'test', namespace: namespace) + @project = create(:project, path: 'test', namespace: namespace) note = create(:note_on_issue, project: @project) expect(helper.note_url(note)).to eq("/nm/test/notes/#{note.id}") @@ -241,7 +241,7 @@ describe NotesHelper do it 'returns namespace, project and note for project snippet' do namespace = create(:namespace, path: 'nm') - @project = create(:empty_project, path: 'test', namespace: namespace) + @project = create(:project, path: 'test', namespace: namespace) @snippet = create(:project_snippet, project: @project) @note = create(:note_on_personal_snippet) @@ -250,7 +250,7 @@ describe NotesHelper do it 'returns namespace, project and note path for other noteables' do namespace = create(:namespace, path: 'nm') - @project = create(:empty_project, path: 'test', namespace: namespace) + @project = create(:project, path: 'test', namespace: namespace) @note = create(:note_on_issue, project: @project) expect(helper.form_resources).to eq([@project.namespace, @project, @note]) @@ -258,7 +258,7 @@ describe NotesHelper do end describe '#noteable_note_url' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:issue) { create(:issue, project: project) } let(:note) { create(:note_on_issue, noteable: issue, project: project) } diff --git a/spec/helpers/projects_helper_spec.rb b/spec/helpers/projects_helper_spec.rb index c447c061919..236a7c29634 100644 --- a/spec/helpers/projects_helper_spec.rb +++ b/spec/helpers/projects_helper_spec.rb @@ -105,7 +105,7 @@ describe ProjectsHelper do describe '#load_pipeline_status' do it 'loads the pipeline status in batch' do - project = build(:empty_project) + project = build(:project) helper.load_pipeline_status([project]) # Skip lazy loading of the `pipeline_status` attribute @@ -193,7 +193,7 @@ describe ProjectsHelper do describe 'link_to_member' do let(:group) { create(:group) } - let(:project) { create(:empty_project, group: group) } + let(:project) { create(:project, group: group) } let(:user) { create(:user) } describe 'using the default options' do @@ -225,7 +225,7 @@ describe ProjectsHelper do end describe '#license_short_name' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } context 'when project.repository has a license_key' do it 'returns the nickname of the license if present' do @@ -312,7 +312,7 @@ describe ProjectsHelper do end describe "#project_feature_access_select" do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:user) { create(:user) } context "when project is internal or public" do @@ -380,7 +380,7 @@ describe ProjectsHelper do end describe '#get_project_nav_tabs' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } before do diff --git a/spec/helpers/search_helper_spec.rb b/spec/helpers/search_helper_spec.rb index 4dab21440a6..463af15930d 100644 --- a/spec/helpers/search_helper_spec.rb +++ b/spec/helpers/search_helper_spec.rb @@ -47,7 +47,7 @@ describe SearchHelper do end it "includes the user's projects" do - project = create(:empty_project, namespace: create(:namespace, owner: user)) + project = create(:project, namespace: create(:namespace, owner: user)) expect(search_autocomplete_opts(project.name).size).to eq(1) end diff --git a/spec/helpers/submodule_helper_spec.rb b/spec/helpers/submodule_helper_spec.rb index 9e561d0f191..c4f4e0d21dc 100644 --- a/spec/helpers/submodule_helper_spec.rb +++ b/spec/helpers/submodule_helper_spec.rb @@ -91,7 +91,7 @@ describe SubmoduleHelper do context 'in-repository submodule' do let(:group) { create(:group, name: "Master Project", path: "master-project") } - let(:project) { create(:empty_project, group: group) } + let(:project) { create(:project, group: group) } before do self.instance_variable_set(:@project, project) end @@ -158,7 +158,7 @@ describe SubmoduleHelper do context 'submodules with relative links' do let(:group) { create(:group, name: "Master Project", path: "master-project") } - let(:project) { create(:empty_project, group: group) } + let(:project) { create(:project, group: group) } let(:commit_id) { sample_commit[:id] } before do @@ -192,7 +192,7 @@ describe SubmoduleHelper do context 'personal project' do let(:user) { create(:user) } - let(:project) { create(:empty_project, namespace: user.namespace) } + let(:project) { create(:project, namespace: user.namespace) } it 'one level down with personal project' do result = relative_self_links('../test.git', commit_id) diff --git a/spec/helpers/todos_helper_spec.rb b/spec/helpers/todos_helper_spec.rb index 18a41ca24e3..f55163c26e9 100644 --- a/spec/helpers/todos_helper_spec.rb +++ b/spec/helpers/todos_helper_spec.rb @@ -15,7 +15,7 @@ describe TodosHelper do end describe '#todo_projects_options' do - let(:projects) { create_list(:empty_project, 3) } + let(:projects) { create_list(:project, 3) } let(:user) { create(:user) } it 'returns users authorised projects in json format' do diff --git a/spec/helpers/visibility_level_helper_spec.rb b/spec/helpers/visibility_level_helper_spec.rb index ad19cf9263d..c3cccbb0d95 100644 --- a/spec/helpers/visibility_level_helper_spec.rb +++ b/spec/helpers/visibility_level_helper_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe VisibilityLevelHelper do - let(:project) { build(:empty_project) } + let(:project) { build(:project) } let(:group) { build(:group) } let(:personal_snippet) { build(:personal_snippet) } let(:project_snippet) { build(:project_snippet) } @@ -60,8 +60,8 @@ describe VisibilityLevelHelper do describe "skip_level?" do describe "forks" do - let(:project) { create(:empty_project, :internal) } - let(:fork_project) { create(:empty_project, forked_from_project: project) } + let(:project) { create(:project, :internal) } + let(:fork_project) { create(:project, forked_from_project: project) } it "skips levels" do expect(skip_level?(fork_project, Gitlab::VisibilityLevel::PUBLIC)).to be_truthy @@ -71,7 +71,7 @@ describe VisibilityLevelHelper do end describe "non-forked project" do - let(:project) { create(:empty_project, :internal) } + let(:project) { create(:project, :internal) } it "skips levels" do expect(skip_level?(project, Gitlab::VisibilityLevel::PUBLIC)).to be_falsey diff --git a/spec/javascripts/fixtures/dashboard.rb b/spec/javascripts/fixtures/dashboard.rb index b2114e65d27..e83db8daaf2 100644 --- a/spec/javascripts/fixtures/dashboard.rb +++ b/spec/javascripts/fixtures/dashboard.rb @@ -5,7 +5,7 @@ describe Dashboard::ProjectsController, '(JavaScript fixtures)', type: :controll let(:admin) { create(:admin) } let(:namespace) { create(:namespace, name: 'frontend-fixtures' )} - let(:project) { create(:empty_project, namespace: namespace, path: 'builds-project') } + let(:project) { create(:project, namespace: namespace, path: 'builds-project') } render_views diff --git a/spec/javascripts/fixtures/deploy_keys.rb b/spec/javascripts/fixtures/deploy_keys.rb index 16e598a4b29..fca3f5b1bfe 100644 --- a/spec/javascripts/fixtures/deploy_keys.rb +++ b/spec/javascripts/fixtures/deploy_keys.rb @@ -6,7 +6,7 @@ describe Projects::DeployKeysController, '(JavaScript fixtures)', type: :control let(:admin) { create(:admin) } let(:namespace) { create(:namespace, name: 'frontend-fixtures' )} let(:project) { create(:project_empty_repo, namespace: namespace, path: 'todos-project') } - let(:project2) { create(:empty_project, :internal)} + let(:project2) { create(:project, :internal)} before(:all) do clean_frontend_fixtures('deploy_keys/') diff --git a/spec/javascripts/fixtures/projects.rb b/spec/javascripts/fixtures/projects.rb index b828eee6629..6c33b240e5c 100644 --- a/spec/javascripts/fixtures/projects.rb +++ b/spec/javascripts/fixtures/projects.rb @@ -5,7 +5,7 @@ describe ProjectsController, '(JavaScript fixtures)', type: :controller do let(:admin) { create(:admin) } let(:namespace) { create(:namespace, name: 'frontend-fixtures' )} - let(:project) { create(:empty_project, namespace: namespace, path: 'builds-project') } + let(:project) { create(:project, namespace: namespace, path: 'builds-project') } render_views diff --git a/spec/lib/api/helpers/pagination_spec.rb b/spec/lib/api/helpers/pagination_spec.rb index 267318faed4..fb3ef04b860 100644 --- a/spec/lib/api/helpers/pagination_spec.rb +++ b/spec/lib/api/helpers/pagination_spec.rb @@ -32,7 +32,7 @@ describe API::Helpers::Pagination do context 'when resource can be paginated' do before do - create_list(:empty_project, 3) + create_list(:project, 3) end describe 'first page' do diff --git a/spec/lib/banzai/filter/abstract_reference_filter_spec.rb b/spec/lib/banzai/filter/abstract_reference_filter_spec.rb index 32d027b026b..7c0ba9ee67f 100644 --- a/spec/lib/banzai/filter/abstract_reference_filter_spec.rb +++ b/spec/lib/banzai/filter/abstract_reference_filter_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Banzai::Filter::AbstractReferenceFilter do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } describe '#references_per_project' do it 'returns a Hash containing references grouped per project paths' do diff --git a/spec/lib/banzai/filter/commit_reference_filter_spec.rb b/spec/lib/banzai/filter/commit_reference_filter_spec.rb index c7cf1c1d582..702fcac0c6f 100644 --- a/spec/lib/banzai/filter/commit_reference_filter_spec.rb +++ b/spec/lib/banzai/filter/commit_reference_filter_spec.rb @@ -121,7 +121,7 @@ describe Banzai::Filter::CommitReferenceFilter do context 'cross-project / same-namespace complete reference' do let(:namespace) { create(:namespace) } - let(:project) { create(:empty_project, namespace: namespace) } + let(:project) { create(:project, namespace: namespace) } let(:project2) { create(:project, :public, :repository, namespace: namespace) } let(:commit) { project2.commit } let(:reference) { "#{project2.full_path}@#{commit.short_id}" } @@ -147,7 +147,7 @@ describe Banzai::Filter::CommitReferenceFilter do context 'cross-project shorthand reference' do let(:namespace) { create(:namespace) } - let(:project) { create(:empty_project, namespace: namespace) } + let(:project) { create(:project, namespace: namespace) } let(:project2) { create(:project, :public, :repository, namespace: namespace) } let(:commit) { project2.commit } let(:reference) { "#{project2.full_path}@#{commit.short_id}" } diff --git a/spec/lib/banzai/filter/gollum_tags_filter_spec.rb b/spec/lib/banzai/filter/gollum_tags_filter_spec.rb index 663e3514436..97d612e6347 100644 --- a/spec/lib/banzai/filter/gollum_tags_filter_spec.rb +++ b/spec/lib/banzai/filter/gollum_tags_filter_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Banzai::Filter::GollumTagsFilter do include FilterSpecHelper - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { double } let(:project_wiki) { ProjectWiki.new(project, user) } diff --git a/spec/lib/banzai/filter/issuable_state_filter_spec.rb b/spec/lib/banzai/filter/issuable_state_filter_spec.rb index bc7cae1df8d..cacb33d3372 100644 --- a/spec/lib/banzai/filter/issuable_state_filter_spec.rb +++ b/spec/lib/banzai/filter/issuable_state_filter_spec.rb @@ -7,8 +7,8 @@ describe Banzai::Filter::IssuableStateFilter do let(:user) { create(:user) } let(:context) { { current_user: user, issuable_state_filter_enabled: true } } let(:closed_issue) { create_issue(:closed) } - let(:project) { create(:empty_project, :public) } - let(:other_project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } + let(:other_project) { create(:project, :public) } def create_link(text, data) link_to(text, '', class: 'gfm has-tooltip', data: data) diff --git a/spec/lib/banzai/filter/issue_reference_filter_spec.rb b/spec/lib/banzai/filter/issue_reference_filter_spec.rb index 024a5cafb41..9c74c9b8c99 100644 --- a/spec/lib/banzai/filter/issue_reference_filter_spec.rb +++ b/spec/lib/banzai/filter/issue_reference_filter_spec.rb @@ -7,7 +7,7 @@ describe Banzai::Filter::IssueReferenceFilter do IssuesHelper end - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:issue) { create(:issue, project: project) } it 'requires project context' do @@ -125,7 +125,7 @@ describe Banzai::Filter::IssueReferenceFilter do context 'cross-project / cross-namespace complete reference' do it_behaves_like 'a reference containing an element node' - let(:project2) { create(:empty_project, :public) } + let(:project2) { create(:project, :public) } let(:issue) { create(:issue, project: project2) } let(:reference) { "#{project2.full_path}##{issue.iid}" } @@ -168,8 +168,8 @@ describe Banzai::Filter::IssueReferenceFilter do it_behaves_like 'a reference containing an element node' let(:namespace) { create(:namespace) } - let(:project) { create(:empty_project, :public, namespace: namespace) } - let(:project2) { create(:empty_project, :public, namespace: namespace) } + let(:project) { create(:project, :public, namespace: namespace) } + let(:project2) { create(:project, :public, namespace: namespace) } let(:issue) { create(:issue, project: project2) } let(:reference) { "#{project2.full_path}##{issue.iid}" } @@ -212,8 +212,8 @@ describe Banzai::Filter::IssueReferenceFilter do it_behaves_like 'a reference containing an element node' let(:namespace) { create(:namespace) } - let(:project) { create(:empty_project, :public, namespace: namespace) } - let(:project2) { create(:empty_project, :public, namespace: namespace) } + let(:project) { create(:project, :public, namespace: namespace) } + let(:project2) { create(:project, :public, namespace: namespace) } let(:issue) { create(:issue, project: project2) } let(:reference) { "#{project2.path}##{issue.iid}" } @@ -256,7 +256,7 @@ describe Banzai::Filter::IssueReferenceFilter do it_behaves_like 'a reference containing an element node' let(:namespace) { create(:namespace, name: 'cross-reference') } - let(:project2) { create(:empty_project, :public, namespace: namespace) } + let(:project2) { create(:project, :public, namespace: namespace) } let(:issue) { create(:issue, project: project2) } let(:reference) { helper.url_for_issue(issue.iid, project2) + "#note_123" } @@ -277,7 +277,7 @@ describe Banzai::Filter::IssueReferenceFilter do it_behaves_like 'a reference containing an element node' let(:namespace) { create(:namespace, name: 'cross-reference') } - let(:project2) { create(:empty_project, :public, namespace: namespace) } + let(:project2) { create(:project, :public, namespace: namespace) } let(:issue) { create(:issue, project: project2) } let(:reference) { issue.to_reference(project) } let(:reference_link) { %{<a href="#{reference}">Reference</a>} } @@ -299,7 +299,7 @@ describe Banzai::Filter::IssueReferenceFilter do it_behaves_like 'a reference containing an element node' let(:namespace) { create(:namespace, name: 'cross-reference') } - let(:project2) { create(:empty_project, :public, namespace: namespace) } + let(:project2) { create(:project, :public, namespace: namespace) } let(:issue) { create(:issue, project: project2) } let(:reference) { "#{helper.url_for_issue(issue.iid, project2) + "#note_123"}" } let(:reference_link) { %{<a href="#{reference}">Reference</a>} } diff --git a/spec/lib/banzai/filter/label_reference_filter_spec.rb b/spec/lib/banzai/filter/label_reference_filter_spec.rb index dfd4c7a7279..2cd30a5e302 100644 --- a/spec/lib/banzai/filter/label_reference_filter_spec.rb +++ b/spec/lib/banzai/filter/label_reference_filter_spec.rb @@ -4,7 +4,7 @@ require 'html/pipeline' describe Banzai::Filter::LabelReferenceFilter do include FilterSpecHelper - let(:project) { create(:empty_project, :public, name: 'sample-project') } + let(:project) { create(:project, :public, name: 'sample-project') } let(:label) { create(:label, project: project) } let(:reference) { label.to_reference } @@ -315,7 +315,7 @@ describe Banzai::Filter::LabelReferenceFilter do describe 'group label references' do let(:group) { create(:group) } - let(:project) { create(:empty_project, :public, namespace: group) } + let(:project) { create(:project, :public, namespace: group) } let(:group_label) { create(:group_label, name: 'gfm references', group: group) } context 'without project reference' do @@ -366,7 +366,7 @@ describe Banzai::Filter::LabelReferenceFilter do end describe 'cross-project / cross-namespace complete reference' do - let(:project2) { create(:empty_project) } + let(:project2) { create(:project) } let(:label) { create(:label, project: project2, color: '#00ff00') } let(:reference) { "#{project2.full_path}~#{label.name}" } let!(:result) { reference_filter("See #{reference}") } @@ -397,8 +397,8 @@ describe Banzai::Filter::LabelReferenceFilter do describe 'cross-project / same-namespace complete reference' do let(:namespace) { create(:namespace) } - let(:project) { create(:empty_project, namespace: namespace) } - let(:project2) { create(:empty_project, namespace: namespace) } + let(:project) { create(:project, namespace: namespace) } + let(:project2) { create(:project, namespace: namespace) } let(:label) { create(:label, project: project2, color: '#00ff00') } let(:reference) { "#{project2.full_path}~#{label.name}" } let!(:result) { reference_filter("See #{reference}") } @@ -429,8 +429,8 @@ describe Banzai::Filter::LabelReferenceFilter do describe 'cross-project shorthand reference' do let(:namespace) { create(:namespace) } - let(:project) { create(:empty_project, namespace: namespace) } - let(:project2) { create(:empty_project, namespace: namespace) } + let(:project) { create(:project, namespace: namespace) } + let(:project2) { create(:project, namespace: namespace) } let(:label) { create(:label, project: project2, color: '#00ff00') } let(:reference) { "#{project2.path}~#{label.name}" } let!(:result) { reference_filter("See #{reference}") } @@ -462,9 +462,9 @@ describe Banzai::Filter::LabelReferenceFilter do describe 'cross group label references' do let(:group) { create(:group) } - let(:project) { create(:empty_project, :public, namespace: group) } + let(:project) { create(:project, :public, namespace: group) } let(:another_group) { create(:group) } - let(:another_project) { create(:empty_project, :public, namespace: another_group) } + let(:another_project) { create(:project, :public, namespace: another_group) } let(:group_label) { create(:group_label, group: another_group, color: '#00ff00') } let(:reference) { "#{another_project.full_path}~#{group_label.name}" } let!(:result) { reference_filter("See #{reference}", project: project) } @@ -498,8 +498,8 @@ describe Banzai::Filter::LabelReferenceFilter do describe 'cross-project / same-group_label complete reference' do let(:group) { create(:group) } - let(:project) { create(:empty_project, :public, namespace: group) } - let(:another_project) { create(:empty_project, :public, namespace: group) } + let(:project) { create(:project, :public, namespace: group) } + let(:another_project) { create(:project, :public, namespace: group) } let(:group_label) { create(:group_label, group: group, color: '#00ff00') } let(:reference) { "#{another_project.full_path}~#{group_label.name}" } let!(:result) { reference_filter("See #{reference}", project: project) } @@ -533,7 +533,7 @@ describe Banzai::Filter::LabelReferenceFilter do describe 'same project / same group_label complete reference' do let(:group) { create(:group) } - let(:project) { create(:empty_project, :public, namespace: group) } + let(:project) { create(:project, :public, namespace: group) } let(:group_label) { create(:group_label, group: group, color: '#00ff00') } let(:reference) { "#{project.full_path}~#{group_label.name}" } let!(:result) { reference_filter("See #{reference}", project: project) } @@ -565,7 +565,7 @@ describe Banzai::Filter::LabelReferenceFilter do describe 'same project / same group_label shorthand reference' do let(:group) { create(:group) } - let(:project) { create(:empty_project, :public, namespace: group) } + let(:project) { create(:project, :public, namespace: group) } let(:group_label) { create(:group_label, group: group, color: '#00ff00') } let(:reference) { "#{project.path}~#{group_label.name}" } let!(:result) { reference_filter("See #{reference}", project: project) } diff --git a/spec/lib/banzai/filter/merge_request_reference_filter_spec.rb b/spec/lib/banzai/filter/merge_request_reference_filter_spec.rb index b693ae3eca2..ed2788f8a33 100644 --- a/spec/lib/banzai/filter/merge_request_reference_filter_spec.rb +++ b/spec/lib/banzai/filter/merge_request_reference_filter_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Banzai::Filter::MergeRequestReferenceFilter do include FilterSpecHelper - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:merge) { create(:merge_request, source_project: project) } it 'requires project context' do @@ -100,7 +100,7 @@ describe Banzai::Filter::MergeRequestReferenceFilter do end context 'cross-project / cross-namespace complete reference' do - let(:project2) { create(:empty_project, :public) } + let(:project2) { create(:project, :public) } let(:merge) { create(:merge_request, source_project: project2) } let(:reference) { "#{project2.full_path}!#{merge.iid}" } @@ -132,8 +132,8 @@ describe Banzai::Filter::MergeRequestReferenceFilter do context 'cross-project / same-namespace complete reference' do let(:namespace) { create(:namespace) } - let(:project) { create(:empty_project, :public, namespace: namespace) } - let(:project2) { create(:empty_project, :public, namespace: namespace) } + let(:project) { create(:project, :public, namespace: namespace) } + let(:project2) { create(:project, :public, namespace: namespace) } let!(:merge) { create(:merge_request, source_project: project2) } let(:reference) { "#{project2.full_path}!#{merge.iid}" } @@ -165,8 +165,8 @@ describe Banzai::Filter::MergeRequestReferenceFilter do context 'cross-project shorthand reference' do let(:namespace) { create(:namespace) } - let(:project) { create(:empty_project, :public, namespace: namespace) } - let(:project2) { create(:empty_project, :public, namespace: namespace) } + let(:project) { create(:project, :public, namespace: namespace) } + let(:project2) { create(:project, :public, namespace: namespace) } let!(:merge) { create(:merge_request, source_project: project2) } let(:reference) { "#{project2.path}!#{merge.iid}" } @@ -198,7 +198,7 @@ describe Banzai::Filter::MergeRequestReferenceFilter do context 'cross-project URL reference' do let(:namespace) { create(:namespace, name: 'cross-reference') } - let(:project2) { create(:empty_project, :public, namespace: namespace) } + let(:project2) { create(:project, :public, namespace: namespace) } let(:merge) { create(:merge_request, source_project: project2, target_project: project2) } let(:reference) { urls.project_merge_request_url(project2, merge) + '/diffs#note_123' } diff --git a/spec/lib/banzai/filter/milestone_reference_filter_spec.rb b/spec/lib/banzai/filter/milestone_reference_filter_spec.rb index 79ff9419e4b..5db77566513 100644 --- a/spec/lib/banzai/filter/milestone_reference_filter_spec.rb +++ b/spec/lib/banzai/filter/milestone_reference_filter_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Banzai::Filter::MilestoneReferenceFilter do include FilterSpecHelper - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:milestone) { create(:milestone, project: project) } let(:reference) { milestone.to_reference } @@ -150,7 +150,7 @@ describe Banzai::Filter::MilestoneReferenceFilter do describe 'cross-project / cross-namespace complete reference' do let(:namespace) { create(:namespace) } - let(:another_project) { create(:empty_project, :public, namespace: namespace) } + let(:another_project) { create(:project, :public, namespace: namespace) } let(:milestone) { create(:milestone, project: another_project) } let(:reference) { "#{another_project.full_path}%#{milestone.iid}" } let!(:result) { reference_filter("See #{reference}") } @@ -186,8 +186,8 @@ describe Banzai::Filter::MilestoneReferenceFilter do describe 'cross-project / same-namespace complete reference' do let(:namespace) { create(:namespace) } - let(:project) { create(:empty_project, :public, namespace: namespace) } - let(:another_project) { create(:empty_project, :public, namespace: namespace) } + let(:project) { create(:project, :public, namespace: namespace) } + let(:another_project) { create(:project, :public, namespace: namespace) } let(:milestone) { create(:milestone, project: another_project) } let(:reference) { "#{another_project.full_path}%#{milestone.iid}" } let!(:result) { reference_filter("See #{reference}") } @@ -223,8 +223,8 @@ describe Banzai::Filter::MilestoneReferenceFilter do describe 'cross project shorthand reference' do let(:namespace) { create(:namespace) } - let(:project) { create(:empty_project, :public, namespace: namespace) } - let(:another_project) { create(:empty_project, :public, namespace: namespace) } + let(:project) { create(:project, :public, namespace: namespace) } + let(:another_project) { create(:project, :public, namespace: namespace) } let(:milestone) { create(:milestone, project: another_project) } let(:reference) { "#{another_project.path}%#{milestone.iid}" } let!(:result) { reference_filter("See #{reference}") } @@ -259,7 +259,7 @@ describe Banzai::Filter::MilestoneReferenceFilter do end describe 'cross project milestone references' do - let(:another_project) { create(:empty_project, :public) } + let(:another_project) { create(:project, :public) } let(:project_path) { another_project.full_path } let(:milestone) { create(:milestone, project: another_project) } let(:reference) { milestone.to_reference(project) } diff --git a/spec/lib/banzai/filter/redactor_filter_spec.rb b/spec/lib/banzai/filter/redactor_filter_spec.rb index fb6b81d4f10..68643effb66 100644 --- a/spec/lib/banzai/filter/redactor_filter_spec.rb +++ b/spec/lib/banzai/filter/redactor_filter_spec.rb @@ -17,7 +17,7 @@ describe Banzai::Filter::RedactorFilter do it 'skips when the skip_redaction flag is set' do user = create(:user) - project = create(:empty_project) + project = create(:project) link = reference_link(project: project.id, reference_type: 'test') doc = filter(link, current_user: user, skip_redaction: true) @@ -45,7 +45,7 @@ describe Banzai::Filter::RedactorFilter do it 'allows permitted Project references' do user = create(:user) - project = create(:empty_project) + project = create(:project) project.team << [user, :master] link = reference_link(project: project.id, reference_type: 'test') @@ -62,7 +62,7 @@ describe Banzai::Filter::RedactorFilter do it 'removes unpermitted references' do user = create(:user) - project = create(:empty_project) + project = create(:project) link = reference_link(project: project.id, reference_type: 'test') doc = filter(link, current_user: user) @@ -82,7 +82,7 @@ describe Banzai::Filter::RedactorFilter do context 'for confidential issues' do it 'removes references for non project members' do non_member = create(:user) - project = create(:empty_project, :public) + project = create(:project, :public) issue = create(:issue, :confidential, project: project) link = reference_link(project: project.id, issue: issue.id, reference_type: 'issue') @@ -93,7 +93,7 @@ describe Banzai::Filter::RedactorFilter do it 'removes references for project members with guest role' do member = create(:user) - project = create(:empty_project, :public) + project = create(:project, :public) project.team << [member, :guest] issue = create(:issue, :confidential, project: project) @@ -105,7 +105,7 @@ describe Banzai::Filter::RedactorFilter do it 'allows references for author' do author = create(:user) - project = create(:empty_project, :public) + project = create(:project, :public) issue = create(:issue, :confidential, project: project, author: author) link = reference_link(project: project.id, issue: issue.id, reference_type: 'issue') @@ -116,7 +116,7 @@ describe Banzai::Filter::RedactorFilter do it 'allows references for assignee' do assignee = create(:user) - project = create(:empty_project, :public) + project = create(:project, :public) issue = create(:issue, :confidential, project: project, assignees: [assignee]) link = reference_link(project: project.id, issue: issue.id, reference_type: 'issue') @@ -127,7 +127,7 @@ describe Banzai::Filter::RedactorFilter do it 'allows references for project members' do member = create(:user) - project = create(:empty_project, :public) + project = create(:project, :public) project.team << [member, :developer] issue = create(:issue, :confidential, project: project) @@ -139,7 +139,7 @@ describe Banzai::Filter::RedactorFilter do it 'allows references for admin' do admin = create(:admin) - project = create(:empty_project, :public) + project = create(:project, :public) issue = create(:issue, :confidential, project: project) link = reference_link(project: project.id, issue: issue.id, reference_type: 'issue') @@ -151,7 +151,7 @@ describe Banzai::Filter::RedactorFilter do it 'allows references for non confidential issues' do user = create(:user) - project = create(:empty_project, :public) + project = create(:project, :public) issue = create(:issue, project: project) link = reference_link(project: project.id, issue: issue.id, reference_type: 'issue') diff --git a/spec/lib/banzai/filter/reference_filter_spec.rb b/spec/lib/banzai/filter/reference_filter_spec.rb index 81f244a4539..f96b6c83b0a 100644 --- a/spec/lib/banzai/filter/reference_filter_spec.rb +++ b/spec/lib/banzai/filter/reference_filter_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Banzai::Filter::ReferenceFilter do - let(:project) { build_stubbed(:empty_project) } + let(:project) { build_stubbed(:project) } describe '#each_node' do it 'iterates over the nodes in a document' do diff --git a/spec/lib/banzai/filter/relative_link_filter_spec.rb b/spec/lib/banzai/filter/relative_link_filter_spec.rb index e97199672f3..08beede62db 100644 --- a/spec/lib/banzai/filter/relative_link_filter_spec.rb +++ b/spec/lib/banzai/filter/relative_link_filter_spec.rb @@ -56,7 +56,7 @@ describe Banzai::Filter::RelativeLinkFilter do end context 'without a repository' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } include_examples :preserve_unchanged end diff --git a/spec/lib/banzai/filter/snippet_reference_filter_spec.rb b/spec/lib/banzai/filter/snippet_reference_filter_spec.rb index a7eee7a4515..90ac4c7b238 100644 --- a/spec/lib/banzai/filter/snippet_reference_filter_spec.rb +++ b/spec/lib/banzai/filter/snippet_reference_filter_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Banzai::Filter::SnippetReferenceFilter do include FilterSpecHelper - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:snippet) { create(:project_snippet, project: project) } let(:reference) { snippet.to_reference } @@ -81,7 +81,7 @@ describe Banzai::Filter::SnippetReferenceFilter do context 'cross-project / cross-namespace complete reference' do let(:namespace) { create(:namespace) } - let(:project2) { create(:empty_project, :public, namespace: namespace) } + let(:project2) { create(:project, :public, namespace: namespace) } let!(:snippet) { create(:project_snippet, project: project2) } let(:reference) { "#{project2.full_path}$#{snippet.id}" } @@ -113,8 +113,8 @@ describe Banzai::Filter::SnippetReferenceFilter do context 'cross-project / same-namespace complete reference' do let(:namespace) { create(:namespace) } - let(:project) { create(:empty_project, :public, namespace: namespace) } - let(:project2) { create(:empty_project, :public, namespace: namespace) } + let(:project) { create(:project, :public, namespace: namespace) } + let(:project2) { create(:project, :public, namespace: namespace) } let!(:snippet) { create(:project_snippet, project: project2) } let(:reference) { "#{project2.full_path}$#{snippet.id}" } @@ -146,8 +146,8 @@ describe Banzai::Filter::SnippetReferenceFilter do context 'cross-project shorthand reference' do let(:namespace) { create(:namespace) } - let(:project) { create(:empty_project, :public, namespace: namespace) } - let(:project2) { create(:empty_project, :public, namespace: namespace) } + let(:project) { create(:project, :public, namespace: namespace) } + let(:project2) { create(:project, :public, namespace: namespace) } let!(:snippet) { create(:project_snippet, project: project2) } let(:reference) { "#{project2.path}$#{snippet.id}" } @@ -179,7 +179,7 @@ describe Banzai::Filter::SnippetReferenceFilter do context 'cross-project URL reference' do let(:namespace) { create(:namespace, name: 'cross-reference') } - let(:project2) { create(:empty_project, :public, namespace: namespace) } + let(:project2) { create(:project, :public, namespace: namespace) } let(:snippet) { create(:project_snippet, project: project2) } let(:reference) { urls.project_snippet_url(project2, snippet) } diff --git a/spec/lib/banzai/filter/upload_link_filter_spec.rb b/spec/lib/banzai/filter/upload_link_filter_spec.rb index 74a23a9ab5e..60a88e903ef 100644 --- a/spec/lib/banzai/filter/upload_link_filter_spec.rb +++ b/spec/lib/banzai/filter/upload_link_filter_spec.rb @@ -29,7 +29,7 @@ describe Banzai::Filter::UploadLinkFilter do %(<div><a href="#{path}">#{path}</a></div>) end - let(:project) { create(:empty_project) } + let(:project) { create(:project) } shared_examples :preserve_unchanged do it 'does not modify any relative URL in anchor' do diff --git a/spec/lib/banzai/filter/user_reference_filter_spec.rb b/spec/lib/banzai/filter/user_reference_filter_spec.rb index 7ea9df5eda5..34dac1db69a 100644 --- a/spec/lib/banzai/filter/user_reference_filter_spec.rb +++ b/spec/lib/banzai/filter/user_reference_filter_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Banzai::Filter::UserReferenceFilter do include FilterSpecHelper - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:user) { create(:user) } let(:reference) { user.to_reference } diff --git a/spec/lib/banzai/filter/wiki_link_filter_spec.rb b/spec/lib/banzai/filter/wiki_link_filter_spec.rb index ceafd12a68e..9596f004052 100644 --- a/spec/lib/banzai/filter/wiki_link_filter_spec.rb +++ b/spec/lib/banzai/filter/wiki_link_filter_spec.rb @@ -4,7 +4,7 @@ describe Banzai::Filter::WikiLinkFilter do include FilterSpecHelper let(:namespace) { build_stubbed(:namespace, name: "wiki_link_ns") } - let(:project) { build_stubbed(:empty_project, :public, name: "wiki_link_project", namespace: namespace) } + let(:project) { build_stubbed(:project, :public, name: "wiki_link_project", namespace: namespace) } let(:user) { double } let(:wiki) { ProjectWiki.new(project, user) } diff --git a/spec/lib/banzai/issuable_extractor_spec.rb b/spec/lib/banzai/issuable_extractor_spec.rb index 728271e757b..69763476dac 100644 --- a/spec/lib/banzai/issuable_extractor_spec.rb +++ b/spec/lib/banzai/issuable_extractor_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Banzai::IssuableExtractor do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } let(:extractor) { described_class.new(project, user) } let(:issue) { create(:issue, project: project) } diff --git a/spec/lib/banzai/object_renderer_spec.rb b/spec/lib/banzai/object_renderer_spec.rb index dd2674f9f20..7f5d481c36c 100644 --- a/spec/lib/banzai/object_renderer_spec.rb +++ b/spec/lib/banzai/object_renderer_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Banzai::ObjectRenderer do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { project.owner } let(:renderer) { described_class.new(project, user, custom_value: 'value') } let(:object) { Note.new(note: 'hello', note_html: '<p dir="auto">hello</p>', cached_markdown_version: CacheMarkdownField::CACHE_VERSION) } @@ -28,7 +28,7 @@ describe Banzai::ObjectRenderer do it 'passes context to PostProcessPipeline' do another_user = create(:user) - another_project = create(:empty_project) + another_project = create(:project) object = Note.new( note: 'hello', note_html: 'hello', diff --git a/spec/lib/banzai/pipeline/full_pipeline_spec.rb b/spec/lib/banzai/pipeline/full_pipeline_spec.rb index 2501b638774..e9c7a2f352e 100644 --- a/spec/lib/banzai/pipeline/full_pipeline_spec.rb +++ b/spec/lib/banzai/pipeline/full_pipeline_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' describe Banzai::Pipeline::FullPipeline do describe 'References' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:issue) { create(:issue, project: project) } it 'handles markdown inside a reference' do diff --git a/spec/lib/banzai/pipeline/gfm_pipeline_spec.rb b/spec/lib/banzai/pipeline/gfm_pipeline_spec.rb index 601ffbb5456..75413596431 100644 --- a/spec/lib/banzai/pipeline/gfm_pipeline_spec.rb +++ b/spec/lib/banzai/pipeline/gfm_pipeline_spec.rb @@ -36,7 +36,7 @@ describe Banzai::Pipeline::GfmPipeline do end it 'parses cross-project references to regular issues' do - other_project = create(:empty_project, :public) + other_project = create(:project, :public) issue = create(:issue, project: other_project) markdown = issue.to_reference(project, full: true) @@ -74,7 +74,7 @@ describe Banzai::Pipeline::GfmPipeline do end it 'parses cross-project references to regular issues' do - other_project = create(:empty_project, :public) + other_project = create(:project, :public) issue = create(:issue, project: other_project) markdown = issue.to_reference(project, full: true) diff --git a/spec/lib/banzai/pipeline/wiki_pipeline_spec.rb b/spec/lib/banzai/pipeline/wiki_pipeline_spec.rb index ac9bde6baf1..88ae4c1e07a 100644 --- a/spec/lib/banzai/pipeline/wiki_pipeline_spec.rb +++ b/spec/lib/banzai/pipeline/wiki_pipeline_spec.rb @@ -53,7 +53,7 @@ describe Banzai::Pipeline::WikiPipeline do describe "Links" do let(:namespace) { create(:namespace, name: "wiki_link_ns") } - let(:project) { create(:empty_project, :public, name: "wiki_link_project", namespace: namespace) } + let(:project) { create(:project, :public, name: "wiki_link_project", namespace: namespace) } let(:project_wiki) { ProjectWiki.new(project, double(:user)) } let(:page) { build(:wiki_page, wiki: project_wiki, page: OpenStruct.new(url_path: 'nested/twice/start-page')) } diff --git a/spec/lib/banzai/redactor_spec.rb b/spec/lib/banzai/redactor_spec.rb index 81ae5685b10..2424c3fdc66 100644 --- a/spec/lib/banzai/redactor_spec.rb +++ b/spec/lib/banzai/redactor_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Banzai::Redactor do let(:user) { build(:user) } - let(:project) { build(:empty_project) } + let(:project) { build(:project) } let(:redactor) { described_class.new(project, user) } describe '#redact' do diff --git a/spec/lib/banzai/reference_parser/base_parser_spec.rb b/spec/lib/banzai/reference_parser/base_parser_spec.rb index 0bf45329657..6175d4c4ca9 100644 --- a/spec/lib/banzai/reference_parser/base_parser_spec.rb +++ b/spec/lib/banzai/reference_parser/base_parser_spec.rb @@ -4,7 +4,7 @@ describe Banzai::ReferenceParser::BaseParser do include ReferenceParserHelpers let(:user) { create(:user) } - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } subject do klass = Class.new(described_class) do diff --git a/spec/lib/banzai/reference_parser/commit_parser_spec.rb b/spec/lib/banzai/reference_parser/commit_parser_spec.rb index 69bf28cdf85..3505659c2c3 100644 --- a/spec/lib/banzai/reference_parser/commit_parser_spec.rb +++ b/spec/lib/banzai/reference_parser/commit_parser_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Banzai::ReferenceParser::CommitParser do include ReferenceParserHelpers - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:user) { create(:user) } subject { described_class.new(project, user) } let(:link) { empty_html_link } diff --git a/spec/lib/banzai/reference_parser/commit_range_parser_spec.rb b/spec/lib/banzai/reference_parser/commit_range_parser_spec.rb index b384a59bfb4..21813177deb 100644 --- a/spec/lib/banzai/reference_parser/commit_range_parser_spec.rb +++ b/spec/lib/banzai/reference_parser/commit_range_parser_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Banzai::ReferenceParser::CommitRangeParser do include ReferenceParserHelpers - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:user) { create(:user) } subject { described_class.new(project, user) } let(:link) { empty_html_link } diff --git a/spec/lib/banzai/reference_parser/external_issue_parser_spec.rb b/spec/lib/banzai/reference_parser/external_issue_parser_spec.rb index a3256afdbb1..25969b65168 100644 --- a/spec/lib/banzai/reference_parser/external_issue_parser_spec.rb +++ b/spec/lib/banzai/reference_parser/external_issue_parser_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Banzai::ReferenceParser::ExternalIssueParser do include ReferenceParserHelpers - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:user) { create(:user) } subject { described_class.new(project, user) } let(:link) { empty_html_link } diff --git a/spec/lib/banzai/reference_parser/issue_parser_spec.rb b/spec/lib/banzai/reference_parser/issue_parser_spec.rb index 94b989fe91d..23dbe2b6238 100644 --- a/spec/lib/banzai/reference_parser/issue_parser_spec.rb +++ b/spec/lib/banzai/reference_parser/issue_parser_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Banzai::ReferenceParser::IssueParser do include ReferenceParserHelpers - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:user) { create(:user) } let(:issue) { create(:issue, project: project) } let(:link) { empty_html_link } diff --git a/spec/lib/banzai/reference_parser/label_parser_spec.rb b/spec/lib/banzai/reference_parser/label_parser_spec.rb index cf1b2a92195..b700161d6c2 100644 --- a/spec/lib/banzai/reference_parser/label_parser_spec.rb +++ b/spec/lib/banzai/reference_parser/label_parser_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Banzai::ReferenceParser::LabelParser do include ReferenceParserHelpers - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:user) { create(:user) } let(:label) { create(:label, project: project) } subject { described_class.new(project, user) } diff --git a/spec/lib/banzai/reference_parser/milestone_parser_spec.rb b/spec/lib/banzai/reference_parser/milestone_parser_spec.rb index 2cfcafa8798..7dacdf8d629 100644 --- a/spec/lib/banzai/reference_parser/milestone_parser_spec.rb +++ b/spec/lib/banzai/reference_parser/milestone_parser_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Banzai::ReferenceParser::MilestoneParser do include ReferenceParserHelpers - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:user) { create(:user) } let(:milestone) { create(:milestone, project: project) } subject { described_class.new(project, user) } diff --git a/spec/lib/banzai/reference_parser/snippet_parser_spec.rb b/spec/lib/banzai/reference_parser/snippet_parser_spec.rb index c6d0b7be254..69ec3f66aa8 100644 --- a/spec/lib/banzai/reference_parser/snippet_parser_spec.rb +++ b/spec/lib/banzai/reference_parser/snippet_parser_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Banzai::ReferenceParser::SnippetParser do include ReferenceParserHelpers - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:user) { create(:user) } let(:external_user) { create(:user, :external) } diff --git a/spec/lib/banzai/reference_parser/user_parser_spec.rb b/spec/lib/banzai/reference_parser/user_parser_spec.rb index 64f2b607d7c..e49726aca6c 100644 --- a/spec/lib/banzai/reference_parser/user_parser_spec.rb +++ b/spec/lib/banzai/reference_parser/user_parser_spec.rb @@ -5,7 +5,7 @@ describe Banzai::ReferenceParser::UserParser do let(:group) { create(:group) } let(:user) { create(:user) } - let(:project) { create(:empty_project, :public, group: group, creator: user) } + let(:project) { create(:project, :public, group: group, creator: user) } subject { described_class.new(project, user) } let(:link) { empty_html_link } @@ -125,7 +125,7 @@ describe Banzai::ReferenceParser::UserParser do end it 'returns the nodes if the user can read the project' do - other_project = create(:empty_project, :public) + other_project = create(:project, :public) link['data-project'] = other_project.id.to_s @@ -137,7 +137,7 @@ describe Banzai::ReferenceParser::UserParser do end it 'returns an empty Array if the user can not read the project' do - other_project = create(:empty_project, :public) + other_project = create(:project, :public) link['data-project'] = other_project.id.to_s @@ -161,7 +161,7 @@ describe Banzai::ReferenceParser::UserParser do describe '#nodes_user_can_reference' do context 'when the link has a data-author attribute' do it 'returns the nodes when the user is a member of the project' do - other_project = create(:empty_project) + other_project = create(:project) other_project.team << [user, :developer] link['data-project'] = other_project.id.to_s @@ -178,7 +178,7 @@ describe Banzai::ReferenceParser::UserParser do end it 'returns an empty Array when the user could not be found' do - other_project = create(:empty_project) + other_project = create(:project) link['data-project'] = other_project.id.to_s link['data-author'] = '' @@ -187,7 +187,7 @@ describe Banzai::ReferenceParser::UserParser do end it 'returns an empty Array when the user is not a team member' do - other_project = create(:empty_project) + other_project = create(:project) link['data-project'] = other_project.id.to_s link['data-author'] = user.id.to_s diff --git a/spec/lib/ci/charts_spec.rb b/spec/lib/ci/charts_spec.rb index 8e2d2724426..f0769deef21 100644 --- a/spec/lib/ci/charts_spec.rb +++ b/spec/lib/ci/charts_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Ci::Charts do context "pipeline_times" do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:chart) { Ci::Charts::PipelineTime.new(project) } subject { chart.pipeline_times } diff --git a/spec/lib/constraints/project_url_constrainer_spec.rb b/spec/lib/constraints/project_url_constrainer_spec.rb index e4b5dfc574a..92331eb2e5d 100644 --- a/spec/lib/constraints/project_url_constrainer_spec.rb +++ b/spec/lib/constraints/project_url_constrainer_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe ProjectUrlConstrainer do - let!(:project) { create(:empty_project) } + let!(:project) { create(:project) } let!(:namespace) { project.namespace } describe '#matches?' do diff --git a/spec/lib/container_registry/blob_spec.rb b/spec/lib/container_registry/blob_spec.rb index 175fd2e7e13..c73faa55513 100644 --- a/spec/lib/container_registry/blob_spec.rb +++ b/spec/lib/container_registry/blob_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe ContainerRegistry::Blob do let(:group) { create(:group, name: 'group') } - let(:project) { create(:empty_project, path: 'test', group: group) } + let(:project) { create(:project, path: 'test', group: group) } let(:repository) do create(:container_repository, name: 'image', diff --git a/spec/lib/container_registry/path_spec.rb b/spec/lib/container_registry/path_spec.rb index c2bcb54210b..84cacdd3f0d 100644 --- a/spec/lib/container_registry/path_spec.rb +++ b/spec/lib/container_registry/path_spec.rb @@ -90,7 +90,7 @@ describe ContainerRegistry::Path do describe '#has_repository?' do context 'when project exists' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:path) { "#{project.full_path}/my/image" } context 'when path already has matching repository' do @@ -123,8 +123,8 @@ describe ContainerRegistry::Path do let(:path) { 'some_group/some_project' } before do - create(:empty_project, group: group, name: 'some_project') - create(:empty_project, name: 'some_project') + create(:project, group: group, name: 'some_project') + create(:project, name: 'some_project') end it 'returns a correct project' do @@ -142,7 +142,7 @@ describe ContainerRegistry::Path do context 'when matching multi-level path' do let(:project) do - create(:empty_project, group: group, name: 'some_project') + create(:project, group: group, name: 'some_project') end context 'when using the zero-level path' do @@ -192,7 +192,7 @@ describe ContainerRegistry::Path do let(:group) { create(:group, path: 'Some_Group') } before do - create(:empty_project, group: group, name: 'some_project') + create(:project, group: group, name: 'some_project') end context 'when project path equal repository path' do @@ -235,7 +235,7 @@ describe ContainerRegistry::Path do let(:group) { create(:group, path: 'SomeGroup') } before do - create(:empty_project, group: group, name: 'MyProject') + create(:project, group: group, name: 'MyProject') end it 'returns downcased project path' do diff --git a/spec/lib/event_filter_spec.rb b/spec/lib/event_filter_spec.rb index b1366e74802..b0efcab47fb 100644 --- a/spec/lib/event_filter_spec.rb +++ b/spec/lib/event_filter_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe EventFilter do describe '#apply_filter' do let(:source_user) { create(:user) } - let!(:public_project) { create(:empty_project, :public) } + let!(:public_project) { create(:project, :public) } let!(:push_event) { create(:event, :pushed, project: public_project, target: public_project, author: source_user) } let!(:merged_event) { create(:event, :merged, project: public_project, target: public_project, author: source_user) } diff --git a/spec/lib/gitlab/allowable_spec.rb b/spec/lib/gitlab/allowable_spec.rb index 87733d53e92..9d80d480b52 100644 --- a/spec/lib/gitlab/allowable_spec.rb +++ b/spec/lib/gitlab/allowable_spec.rb @@ -9,7 +9,7 @@ describe Gitlab::Allowable do let(:user) { create(:user) } context 'when user is allowed to do something' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } it 'reports correct ability to perform action' do expect(subject.can?(user, :read_project, project)).to be true @@ -17,7 +17,7 @@ describe Gitlab::Allowable do end context 'when user is not allowed to do something' do - let(:project) { create(:empty_project, :private) } + let(:project) { create(:project, :private) } it 'reports correct ability to perform action' do expect(subject.can?(user, :read_project, project)).to be false diff --git a/spec/lib/gitlab/auth_spec.rb b/spec/lib/gitlab/auth_spec.rb index a9db0d5164d..8f57e73e40d 100644 --- a/spec/lib/gitlab/auth_spec.rb +++ b/spec/lib/gitlab/auth_spec.rb @@ -65,7 +65,7 @@ describe Gitlab::Auth do end it 'recognizes other ci services' do - project = create(:empty_project) + project = create(:project) project.create_drone_ci_service(active: true) project.drone_ci_service.update(token: 'token') diff --git a/spec/lib/gitlab/background_migration/migrate_system_uploads_to_new_folder_spec.rb b/spec/lib/gitlab/background_migration/migrate_system_uploads_to_new_folder_spec.rb index a910fb105a5..59f69d1e4b1 100644 --- a/spec/lib/gitlab/background_migration/migrate_system_uploads_to_new_folder_spec.rb +++ b/spec/lib/gitlab/background_migration/migrate_system_uploads_to_new_folder_spec.rb @@ -9,7 +9,7 @@ describe Gitlab::BackgroundMigration::MigrateSystemUploadsToNewFolder do describe '#perform' do it 'renames the path of system-uploads', truncate: true do - upload = create(:upload, model: create(:empty_project), path: 'uploads/system/project/avatar.jpg') + upload = create(:upload, model: create(:project), path: 'uploads/system/project/avatar.jpg') migration.perform('uploads/system/', 'uploads/-/system/') diff --git a/spec/lib/gitlab/backup/repository_spec.rb b/spec/lib/gitlab/backup/repository_spec.rb index 3af69daa585..535cce12780 100644 --- a/spec/lib/gitlab/backup/repository_spec.rb +++ b/spec/lib/gitlab/backup/repository_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Backup::Repository do let(:progress) { StringIO.new } - let!(:project) { create(:empty_project) } + let!(:project) { create(:project) } before do allow(progress).to receive(:puts) diff --git a/spec/lib/gitlab/badge/coverage/metadata_spec.rb b/spec/lib/gitlab/badge/coverage/metadata_spec.rb index 5e93935ea37..74eaf7eaf8b 100644 --- a/spec/lib/gitlab/badge/coverage/metadata_spec.rb +++ b/spec/lib/gitlab/badge/coverage/metadata_spec.rb @@ -3,7 +3,7 @@ require 'lib/gitlab/badge/shared/metadata' describe Gitlab::Badge::Coverage::Metadata do let(:badge) do - double(project: create(:empty_project), ref: 'feature', job: 'test') + double(project: create(:project), ref: 'feature', job: 'test') end let(:metadata) { described_class.new(badge) } diff --git a/spec/lib/gitlab/badge/pipeline/metadata_spec.rb b/spec/lib/gitlab/badge/pipeline/metadata_spec.rb index d537ce8803c..9032a8e9016 100644 --- a/spec/lib/gitlab/badge/pipeline/metadata_spec.rb +++ b/spec/lib/gitlab/badge/pipeline/metadata_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' require 'lib/gitlab/badge/shared/metadata' describe Gitlab::Badge::Pipeline::Metadata do - let(:badge) { double(project: create(:empty_project), ref: 'feature') } + let(:badge) { double(project: create(:project), ref: 'feature') } let(:metadata) { described_class.new(badge) } it_behaves_like 'badge metadata' diff --git a/spec/lib/gitlab/bitbucket_import/importer_spec.rb b/spec/lib/gitlab/bitbucket_import/importer_spec.rb index df66a031fec..d7d6a37f7cf 100644 --- a/spec/lib/gitlab/bitbucket_import/importer_spec.rb +++ b/spec/lib/gitlab/bitbucket_import/importer_spec.rb @@ -52,7 +52,7 @@ describe Gitlab::BitbucketImport::Importer do let(:project) do create( - :empty_project, + :project, import_source: project_identifier, import_data: ProjectImportData.new(credentials: data) ) diff --git a/spec/lib/gitlab/cache/ci/project_pipeline_status_spec.rb b/spec/lib/gitlab/cache/ci/project_pipeline_status_spec.rb index 1fab3b29424..f43d89d7ccd 100644 --- a/spec/lib/gitlab/cache/ci/project_pipeline_status_spec.rb +++ b/spec/lib/gitlab/cache/ci/project_pipeline_status_spec.rb @@ -195,7 +195,7 @@ describe Gitlab::Cache::Ci::ProjectPipelineStatus, :clean_gitlab_redis_cache do end it "doesn't fail for an empty project" do - status_for_empty_commit = described_class.new(create(:empty_project)) + status_for_empty_commit = described_class.new(create(:project)) status_for_empty_commit.load_status @@ -243,7 +243,7 @@ describe Gitlab::Cache::Ci::ProjectPipelineStatus, :clean_gitlab_redis_cache do end it "deletes the cache if the repository doesn't have a head commit" do - empty_project = create(:empty_project) + empty_project = create(:project) Gitlab::Redis::Cache.with do |redis| redis.mapped_hmset(cache_key, { sha: 'sha', status: 'pending', ref: 'master' }) diff --git a/spec/lib/gitlab/ci/status/pipeline/common_spec.rb b/spec/lib/gitlab/ci/status/pipeline/common_spec.rb index f5fd31e8d03..4a5b45e7cae 100644 --- a/spec/lib/gitlab/ci/status/pipeline/common_spec.rb +++ b/spec/lib/gitlab/ci/status/pipeline/common_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Gitlab::Ci::Status::Pipeline::Common do let(:user) { create(:user) } - let(:project) { create(:empty_project, :private) } + let(:project) { create(:project, :private) } let(:pipeline) { create(:ci_pipeline, project: project) } subject do diff --git a/spec/lib/gitlab/ci/status/stage/common_spec.rb b/spec/lib/gitlab/ci/status/stage/common_spec.rb index 8814a7614a0..f5f03ac0395 100644 --- a/spec/lib/gitlab/ci/status/stage/common_spec.rb +++ b/spec/lib/gitlab/ci/status/stage/common_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Gitlab::Ci::Status::Stage::Common do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:pipeline) { create(:ci_empty_pipeline, project: project) } let(:stage) do diff --git a/spec/lib/gitlab/ci/status/stage/factory_spec.rb b/spec/lib/gitlab/ci/status/stage/factory_spec.rb index bbb40e2c1ab..432b07e4902 100644 --- a/spec/lib/gitlab/ci/status/stage/factory_spec.rb +++ b/spec/lib/gitlab/ci/status/stage/factory_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Gitlab::Ci::Status::Stage::Factory do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:pipeline) { create(:ci_empty_pipeline, project: project) } let(:stage) do diff --git a/spec/lib/gitlab/closing_issue_extractor_spec.rb b/spec/lib/gitlab/closing_issue_extractor_spec.rb index 8ff6125ada1..15012495247 100644 --- a/spec/lib/gitlab/closing_issue_extractor_spec.rb +++ b/spec/lib/gitlab/closing_issue_extractor_spec.rb @@ -1,8 +1,8 @@ require 'spec_helper' describe Gitlab::ClosingIssueExtractor do - let(:project) { create(:empty_project) } - let(:project2) { create(:empty_project) } + let(:project) { create(:project) } + let(:project2) { create(:project) } let(:forked_project) { Projects::ForkService.new(project, project.creator).execute } let(:issue) { create(:issue, project: project) } let(:issue2) { create(:issue, project: project2) } diff --git a/spec/lib/gitlab/contributions_calendar_spec.rb b/spec/lib/gitlab/contributions_calendar_spec.rb index 79632e2b6a3..9217d48087e 100644 --- a/spec/lib/gitlab/contributions_calendar_spec.rb +++ b/spec/lib/gitlab/contributions_calendar_spec.rb @@ -5,19 +5,19 @@ describe Gitlab::ContributionsCalendar do let(:user) { create(:user) } let(:private_project) do - create(:empty_project, :private) do |project| + create(:project, :private) do |project| create(:project_member, user: contributor, project: project) end end let(:public_project) do - create(:empty_project, :public) do |project| + create(:project, :public) do |project| create(:project_member, user: contributor, project: project) end end let(:feature_project) do - create(:empty_project, :public, :issues_private) do |project| + create(:project, :public, :issues_private) do |project| create(:project_member, user: contributor, project: project).project end end diff --git a/spec/lib/gitlab/cycle_analytics/permissions_spec.rb b/spec/lib/gitlab/cycle_analytics/permissions_spec.rb index 2d85e712db0..2a0dd7be439 100644 --- a/spec/lib/gitlab/cycle_analytics/permissions_spec.rb +++ b/spec/lib/gitlab/cycle_analytics/permissions_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Gitlab::CycleAnalytics::Permissions do - let(:project) { create(:empty_project, public_builds: false) } + let(:project) { create(:project, public_builds: false) } let(:user) { create(:user) } subject { described_class.get(user: user, project: project) } diff --git a/spec/lib/gitlab/cycle_analytics/shared_event_spec.rb b/spec/lib/gitlab/cycle_analytics/shared_event_spec.rb index 9c5e57342e9..c22d27f60d6 100644 --- a/spec/lib/gitlab/cycle_analytics/shared_event_spec.rb +++ b/spec/lib/gitlab/cycle_analytics/shared_event_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' shared_examples 'default query config' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:event) { described_class.new(project: project, stage: stage_name, options: { from: 1.day.ago }) } it 'has the stage attribute' do diff --git a/spec/lib/gitlab/cycle_analytics/stage_summary_spec.rb b/spec/lib/gitlab/cycle_analytics/stage_summary_spec.rb index 592448aef96..2e67c1c7f78 100644 --- a/spec/lib/gitlab/cycle_analytics/stage_summary_spec.rb +++ b/spec/lib/gitlab/cycle_analytics/stage_summary_spec.rb @@ -15,7 +15,7 @@ describe Gitlab::CycleAnalytics::StageSummary do end it "doesn't find issues from other projects" do - Timecop.freeze(5.days.from_now) { create(:issue, project: create(:empty_project)) } + Timecop.freeze(5.days.from_now) { create(:issue, project: create(:project)) } expect(subject.first[:value]).to eq(0) end diff --git a/spec/lib/gitlab/database/migration_helpers_spec.rb b/spec/lib/gitlab/database/migration_helpers_spec.rb index d3dbd82e8ba..ec2274a70aa 100644 --- a/spec/lib/gitlab/database/migration_helpers_spec.rb +++ b/spec/lib/gitlab/database/migration_helpers_spec.rb @@ -276,7 +276,7 @@ describe Gitlab::Database::MigrationHelpers do before do expect(model).to receive(:transaction_open?).and_return(false) - create_list(:empty_project, 5) + create_list(:project, 5) end it 'updates all the rows in a table' do diff --git a/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base_spec.rb b/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base_spec.rb index 254ce06381e..90aa4f63dd5 100644 --- a/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base_spec.rb +++ b/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base_spec.rb @@ -29,7 +29,7 @@ describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameBase, :trunca end describe '#remove_cached_html_for_projects' do - let(:project) { create(:empty_project, description_html: 'Project description') } + let(:project) { create(:project, description_html: 'Project description') } it 'removes description_html from projects' do subject.remove_cached_html_for_projects([project.id]) @@ -110,7 +110,7 @@ describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameBase, :trunca it "doesn't rename routes that start with a similar name" do other_namespace = create(:namespace, path: 'the-path-but-not-really') - project = create(:empty_project, path: 'the-project', namespace: other_namespace) + project = create(:project, path: 'the-project', namespace: other_namespace) subject.rename_path_for_routable(migration_namespace(namespace)) @@ -131,7 +131,7 @@ describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameBase, :trunca context 'for projects' do let(:parent) { create(:namespace, path: 'the-parent') } - let(:project) { create(:empty_project, path: 'the-path', namespace: parent) } + let(:project) { create(:project, path: 'the-path', namespace: parent) } it 'renames the project called `the-path`' do subject.rename_path_for_routable(migration_project(project)) diff --git a/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_namespaces_spec.rb b/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_namespaces_spec.rb index 95695ca8c16..32ac0b88a9b 100644 --- a/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_namespaces_spec.rb +++ b/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_namespaces_spec.rb @@ -187,7 +187,7 @@ describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameNamespaces, : end it 'invalidates the markdown cache of related projects' do - project = create(:empty_project, namespace: namespace, path: "the-path-project") + project = create(:project, namespace: namespace, path: "the-path-project") expect(subject).to receive(:remove_cached_html_for_projects).with([project.id]) diff --git a/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_projects_spec.rb b/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_projects_spec.rb index 19e23a32bda..595e06a9748 100644 --- a/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_projects_spec.rb +++ b/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_projects_spec.rb @@ -4,7 +4,7 @@ describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameProjects, :tr let(:migration) { FakeRenameReservedPathMigrationV1.new } let(:subject) { described_class.new(['the-path'], migration) } let(:project) do - create(:empty_project, + create(:project, path: 'the-path', namespace: create(:namespace, path: 'known-parent' )) end @@ -17,7 +17,7 @@ describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameProjects, :tr describe '#projects_for_paths' do it 'searches using nested paths' do namespace = create(:namespace, path: 'hello') - project = create(:empty_project, path: 'THE-path', namespace: namespace) + project = create(:project, path: 'THE-path', namespace: namespace) result_ids = described_class.new(['Hello/the-path'], migration) .projects_for_paths.map(&:id) @@ -26,8 +26,8 @@ describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameProjects, :tr end it 'includes the correct projects' do - project = create(:empty_project, path: 'THE-path') - _other_project = create(:empty_project) + project = create(:project, path: 'THE-path') + _other_project = create(:project) result_ids = subject.projects_for_paths.map(&:id) @@ -36,7 +36,7 @@ describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameProjects, :tr end describe '#rename_projects' do - let!(:projects) { create_list(:empty_project, 2, path: 'the-path') } + let!(:projects) { create_list(:project, 2, path: 'the-path') } it 'renames each project' do expect(subject).to receive(:rename_project).twice diff --git a/spec/lib/gitlab/email/attachment_uploader_spec.rb b/spec/lib/gitlab/email/attachment_uploader_spec.rb index 89258d2eca7..f61dbc67ad1 100644 --- a/spec/lib/gitlab/email/attachment_uploader_spec.rb +++ b/spec/lib/gitlab/email/attachment_uploader_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" describe Gitlab::Email::AttachmentUploader do describe "#execute" do - let(:project) { build(:empty_project) } + let(:project) { build(:project) } let(:message_raw) { fixture_file("emails/attachment.eml") } let(:message) { Mail::Message.new(message_raw) } diff --git a/spec/lib/gitlab/email/handler/create_issue_handler_spec.rb b/spec/lib/gitlab/email/handler/create_issue_handler_spec.rb index 6d0e715e889..bd36d1d309d 100644 --- a/spec/lib/gitlab/email/handler/create_issue_handler_spec.rb +++ b/spec/lib/gitlab/email/handler/create_issue_handler_spec.rb @@ -69,7 +69,7 @@ describe Gitlab::Email::Handler::CreateIssueHandler do end context "when project is private" do - let(:project) { create(:empty_project, :private, namespace: namespace) } + let(:project) { create(:project, :private, namespace: namespace) } it "raises a ProjectNotFound if the user is not a member" do expect { receiver.execute }.to raise_error(Gitlab::Email::ProjectNotFound) diff --git a/spec/lib/gitlab/email/handler/unsubscribe_handler_spec.rb b/spec/lib/gitlab/email/handler/unsubscribe_handler_spec.rb index 66c38498e4e..21796694f26 100644 --- a/spec/lib/gitlab/email/handler/unsubscribe_handler_spec.rb +++ b/spec/lib/gitlab/email/handler/unsubscribe_handler_spec.rb @@ -10,7 +10,7 @@ describe Gitlab::Email::Handler::UnsubscribeHandler do end let(:email_raw) { fixture_file('emails/valid_reply.eml').gsub(mail_key, "#{mail_key}+unsubscribe") } - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:user) { create(:user) } let(:noteable) { create(:issue, project: project) } diff --git a/spec/lib/gitlab/gfm/reference_rewriter_spec.rb b/spec/lib/gitlab/gfm/reference_rewriter_spec.rb index eaec699ad90..a3d323fe28a 100644 --- a/spec/lib/gitlab/gfm/reference_rewriter_spec.rb +++ b/spec/lib/gitlab/gfm/reference_rewriter_spec.rb @@ -2,8 +2,8 @@ require 'spec_helper' describe Gitlab::Gfm::ReferenceRewriter do let(:text) { 'some text' } - let(:old_project) { create(:empty_project, name: 'old-project') } - let(:new_project) { create(:empty_project, name: 'new-project') } + let(:old_project) { create(:project, name: 'old-project') } + let(:new_project) { create(:project, name: 'new-project') } let(:user) { create(:user) } before do diff --git a/spec/lib/gitlab/gfm/uploads_rewriter_spec.rb b/spec/lib/gitlab/gfm/uploads_rewriter_spec.rb index fef456eb416..39e3b875c49 100644 --- a/spec/lib/gitlab/gfm/uploads_rewriter_spec.rb +++ b/spec/lib/gitlab/gfm/uploads_rewriter_spec.rb @@ -2,8 +2,8 @@ require 'spec_helper' describe Gitlab::Gfm::UploadsRewriter do let(:user) { create(:user) } - let(:old_project) { create(:empty_project) } - let(:new_project) { create(:empty_project) } + let(:old_project) { create(:project) } + let(:new_project) { create(:project) } let(:rewriter) { described_class.new(text, old_project, user) } context 'text contains links to uploads' do diff --git a/spec/lib/gitlab/gitaly_client/notification_service_spec.rb b/spec/lib/gitlab/gitaly_client/notification_service_spec.rb index 1bcdd5e5497..ffc3a09be30 100644 --- a/spec/lib/gitlab/gitaly_client/notification_service_spec.rb +++ b/spec/lib/gitlab/gitaly_client/notification_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Gitlab::GitalyClient::NotificationService do describe '#post_receive' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:storage_name) { project.repository_storage } let(:relative_path) { project.disk_path + '.git' } subject { described_class.new(project.repository) } diff --git a/spec/lib/gitlab/gitaly_client/ref_service_spec.rb b/spec/lib/gitlab/gitaly_client/ref_service_spec.rb index 2ad24119476..46efc1b18f0 100644 --- a/spec/lib/gitlab/gitaly_client/ref_service_spec.rb +++ b/spec/lib/gitlab/gitaly_client/ref_service_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Gitlab::GitalyClient::RefService do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:storage_name) { project.repository_storage } let(:relative_path) { project.disk_path + '.git' } let(:client) { described_class.new(project.repository) } diff --git a/spec/lib/gitlab/gitaly_client/repository_service_spec.rb b/spec/lib/gitlab/gitaly_client/repository_service_spec.rb index 5a9f3fc130c..5c9c4ed1d7c 100644 --- a/spec/lib/gitlab/gitaly_client/repository_service_spec.rb +++ b/spec/lib/gitlab/gitaly_client/repository_service_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Gitlab::GitalyClient::RepositoryService do - set(:project) { create(:empty_project) } + set(:project) { create(:project) } let(:storage_name) { project.repository_storage } let(:relative_path) { project.path_with_namespace + '.git' } let(:client) { described_class.new(project.repository) } diff --git a/spec/lib/gitlab/github_import/comment_formatter_spec.rb b/spec/lib/gitlab/github_import/comment_formatter_spec.rb index ef89634685a..035ac8c7c1f 100644 --- a/spec/lib/gitlab/github_import/comment_formatter_spec.rb +++ b/spec/lib/gitlab/github_import/comment_formatter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Gitlab::GithubImport::CommentFormatter do let(:client) { double } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:octocat) { double(id: 123456, login: 'octocat', email: 'octocat@example.com') } let(:created_at) { DateTime.strptime('2013-04-10T20:09:31Z') } let(:updated_at) { DateTime.strptime('2014-03-03T18:58:10Z') } diff --git a/spec/lib/gitlab/github_import/issue_formatter_spec.rb b/spec/lib/gitlab/github_import/issue_formatter_spec.rb index 39b15926193..0fc56d92aa6 100644 --- a/spec/lib/gitlab/github_import/issue_formatter_spec.rb +++ b/spec/lib/gitlab/github_import/issue_formatter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Gitlab::GithubImport::IssueFormatter do let(:client) { double } - let!(:project) { create(:empty_project, namespace: create(:namespace, path: 'octocat')) } + let!(:project) { create(:project, namespace: create(:namespace, path: 'octocat')) } let(:octocat) { double(id: 123456, login: 'octocat', email: 'octocat@example.com') } let(:created_at) { DateTime.strptime('2011-01-26T19:01:12Z') } let(:updated_at) { DateTime.strptime('2011-01-27T19:01:12Z') } diff --git a/spec/lib/gitlab/github_import/label_formatter_spec.rb b/spec/lib/gitlab/github_import/label_formatter_spec.rb index 2cc7ac0b446..83fdd2cc415 100644 --- a/spec/lib/gitlab/github_import/label_formatter_spec.rb +++ b/spec/lib/gitlab/github_import/label_formatter_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Gitlab::GithubImport::LabelFormatter do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:raw) { double(name: 'improvements', color: 'e6e6e6') } subject { described_class.new(project, raw) } diff --git a/spec/lib/gitlab/github_import/milestone_formatter_spec.rb b/spec/lib/gitlab/github_import/milestone_formatter_spec.rb index 310e0536fd7..683fa51b78e 100644 --- a/spec/lib/gitlab/github_import/milestone_formatter_spec.rb +++ b/spec/lib/gitlab/github_import/milestone_formatter_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Gitlab::GithubImport::MilestoneFormatter do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:created_at) { DateTime.strptime('2011-01-26T19:01:12Z') } let(:updated_at) { DateTime.strptime('2011-01-27T19:01:12Z') } let(:base_data) do diff --git a/spec/lib/gitlab/github_import/release_formatter_spec.rb b/spec/lib/gitlab/github_import/release_formatter_spec.rb index 1357cb636ae..926bf725d6a 100644 --- a/spec/lib/gitlab/github_import/release_formatter_spec.rb +++ b/spec/lib/gitlab/github_import/release_formatter_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Gitlab::GithubImport::ReleaseFormatter do - let!(:project) { create(:empty_project, namespace: create(:namespace, path: 'octocat')) } + let!(:project) { create(:project, namespace: create(:namespace, path: 'octocat')) } let(:octocat) { double(id: 123456, login: 'octocat') } let(:created_at) { DateTime.strptime('2011-01-26T19:01:12Z') } diff --git a/spec/lib/gitlab/github_import/wiki_formatter_spec.rb b/spec/lib/gitlab/github_import/wiki_formatter_spec.rb index 119bf2b5662..fcd90fab547 100644 --- a/spec/lib/gitlab/github_import/wiki_formatter_spec.rb +++ b/spec/lib/gitlab/github_import/wiki_formatter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Gitlab::GithubImport::WikiFormatter do let(:project) do - create(:empty_project, + create(:project, namespace: create(:namespace, path: 'gitlabhq'), import_url: 'https://xxx@github.com/gitlabhq/sample.gitlabhq.git') end diff --git a/spec/lib/gitlab/gitlab_import/importer_spec.rb b/spec/lib/gitlab/gitlab_import/importer_spec.rb index 16b14474b89..e1d935602b5 100644 --- a/spec/lib/gitlab/gitlab_import/importer_spec.rb +++ b/spec/lib/gitlab/gitlab_import/importer_spec.rb @@ -24,7 +24,7 @@ describe Gitlab::GitlabImport::Importer do end it 'persists issues' do - project = create(:empty_project, import_source: 'asd/vim') + project = create(:project, import_source: 'asd/vim') project.build_import_data(credentials: { password: 'password' }) subject = described_class.new(project) diff --git a/spec/lib/gitlab/google_code_import/importer_spec.rb b/spec/lib/gitlab/google_code_import/importer_spec.rb index 85f40825005..798ea0bac58 100644 --- a/spec/lib/gitlab/google_code_import/importer_spec.rb +++ b/spec/lib/gitlab/google_code_import/importer_spec.rb @@ -10,7 +10,7 @@ describe Gitlab::GoogleCodeImport::Importer do 'user_map' => { 'thilo...' => "@#{mapped_user.username}" } } end - let(:project) { create(:empty_project) } + let(:project) { create(:project) } subject { described_class.new(project) } diff --git a/spec/lib/gitlab/graphs/commits_spec.rb b/spec/lib/gitlab/graphs/commits_spec.rb index 3f9382a9143..b2084f56640 100644 --- a/spec/lib/gitlab/graphs/commits_spec.rb +++ b/spec/lib/gitlab/graphs/commits_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Gitlab::Graphs::Commits do - let!(:project) { create(:empty_project, :public) } + let!(:project) { create(:project, :public) } let!(:commit1) { create(:commit, git_commit: RepoHelpers.sample_commit, project: project, committed_date: Time.now) } let!(:commit1_yesterday) { create(:commit, git_commit: RepoHelpers.sample_commit, project: project, committed_date: 1.day.ago)} diff --git a/spec/lib/gitlab/identifier_spec.rb b/spec/lib/gitlab/identifier_spec.rb index 29912da2e25..cfaeb1f0d4f 100644 --- a/spec/lib/gitlab/identifier_spec.rb +++ b/spec/lib/gitlab/identifier_spec.rb @@ -5,7 +5,7 @@ describe Gitlab::Identifier do Class.new { include Gitlab::Identifier }.new end - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } let(:key) { create(:key, user: user) } diff --git a/spec/lib/gitlab/import_export/avatar_restorer_spec.rb b/spec/lib/gitlab/import_export/avatar_restorer_spec.rb index a7b292c8558..a93a921e459 100644 --- a/spec/lib/gitlab/import_export/avatar_restorer_spec.rb +++ b/spec/lib/gitlab/import_export/avatar_restorer_spec.rb @@ -4,7 +4,7 @@ describe Gitlab::ImportExport::AvatarRestorer do include UploadHelpers let(:shared) { Gitlab::ImportExport::Shared.new(relative_path: 'test') } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } before do allow_any_instance_of(described_class).to receive(:avatar_export_file) diff --git a/spec/lib/gitlab/import_export/avatar_saver_spec.rb b/spec/lib/gitlab/import_export/avatar_saver_spec.rb index 814f85de03b..3fb5ddde8b5 100644 --- a/spec/lib/gitlab/import_export/avatar_saver_spec.rb +++ b/spec/lib/gitlab/import_export/avatar_saver_spec.rb @@ -3,8 +3,8 @@ require 'spec_helper' describe Gitlab::ImportExport::AvatarSaver do let(:shared) { Gitlab::ImportExport::Shared.new(relative_path: 'test') } let(:export_path) { "#{Dir.tmpdir}/project_tree_saver_spec" } - let(:project_with_avatar) { create(:empty_project, avatar: fixture_file_upload(Rails.root + "spec/fixtures/dk.png", "image/png")) } - let(:project) { create(:empty_project) } + let(:project_with_avatar) { create(:project, avatar: fixture_file_upload(Rails.root + "spec/fixtures/dk.png", "image/png")) } + let(:project) { create(:project) } before do FileUtils.mkdir_p("#{shared.export_path}/avatar/") diff --git a/spec/lib/gitlab/import_export/fork_spec.rb b/spec/lib/gitlab/import_export/fork_spec.rb index 230cc2d3006..c7fbc2bc92f 100644 --- a/spec/lib/gitlab/import_export/fork_spec.rb +++ b/spec/lib/gitlab/import_export/fork_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe 'forked project import' do let(:user) { create(:user) } let!(:project_with_repo) { create(:project, :repository, name: 'test-repo-restorer', path: 'test-repo-restorer') } - let!(:project) { create(:empty_project, name: 'test-repo-restorer-no-repo', path: 'test-repo-restorer-no-repo') } + let!(:project) { create(:project, name: 'test-repo-restorer-no-repo', path: 'test-repo-restorer-no-repo') } let(:export_path) { "#{Dir.tmpdir}/project_tree_saver_spec" } let(:shared) { Gitlab::ImportExport::Shared.new(relative_path: project.full_path) } let(:forked_from_project) { create(:project, :repository) } diff --git a/spec/lib/gitlab/import_export/import_export_spec.rb b/spec/lib/gitlab/import_export/import_export_spec.rb index 07415d41f93..40a5f2294a2 100644 --- a/spec/lib/gitlab/import_export/import_export_spec.rb +++ b/spec/lib/gitlab/import_export/import_export_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Gitlab::ImportExport do describe 'export filename' do let(:group) { create(:group, :nested) } - let(:project) { create(:empty_project, :public, path: 'project-path', namespace: group) } + let(:project) { create(:project, :public, path: 'project-path', namespace: group) } it 'contains the project path' do expect(described_class.export_filename(project: project)).to include(project.path) diff --git a/spec/lib/gitlab/import_export/members_mapper_spec.rb b/spec/lib/gitlab/import_export/members_mapper_spec.rb index f66a2ab7dda..246f009ad27 100644 --- a/spec/lib/gitlab/import_export/members_mapper_spec.rb +++ b/spec/lib/gitlab/import_export/members_mapper_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Gitlab::ImportExport::MembersMapper do describe 'map members' do let(:user) { create(:admin) } - let(:project) { create(:empty_project, :public, name: 'searchable_project') } + let(:project) { create(:project, :public, name: 'searchable_project') } let(:user2) { create(:user) } let(:exported_user_id) { 99 } let(:exported_members) do @@ -96,7 +96,7 @@ describe Gitlab::ImportExport::MembersMapper do context 'importer same as group member' do let(:user2) { create(:admin) } let(:group) { create(:group) } - let(:project) { create(:empty_project, :public, name: 'searchable_project', namespace: group) } + let(:project) { create(:project, :public, name: 'searchable_project', namespace: group) } let(:members_mapper) do described_class.new( exported_members: exported_members, user: user2, project: project) @@ -119,7 +119,7 @@ describe Gitlab::ImportExport::MembersMapper do context 'importing group members' do let(:group) { create(:group) } - let(:project) { create(:empty_project, namespace: group) } + let(:project) { create(:project, namespace: group) } let(:members_mapper) do described_class.new( exported_members: exported_members, user: user, project: project) diff --git a/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb b/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb index d1ec0e45bbd..7ee0e22f28d 100644 --- a/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb +++ b/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb @@ -9,7 +9,7 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do RSpec::Mocks.with_temporary_scope do @shared = Gitlab::ImportExport::Shared.new(relative_path: "", project_path: 'path') allow(@shared).to receive(:export_path).and_return('spec/lib/gitlab/import_export/') - @project = create(:empty_project, :builds_disabled, :issues_disabled, name: 'project', path: 'project') + @project = create(:project, :builds_disabled, :issues_disabled, name: 'project', path: 'project') project_tree_restorer = described_class.new(user: @user, shared: @shared, project: @project) @restored_project_json = project_tree_restorer.restore end @@ -178,7 +178,7 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do context 'Light JSON' do let(:user) { create(:user) } let(:shared) { Gitlab::ImportExport::Shared.new(relative_path: "", project_path: 'path') } - let!(:project) { create(:empty_project, :builds_disabled, :issues_disabled, name: 'project', path: 'project') } + let!(:project) { create(:project, :builds_disabled, :issues_disabled, name: 'project', path: 'project') } let(:project_tree_restorer) { described_class.new(user: user, shared: shared, project: project) } let(:restored_project_json) { project_tree_restorer.restore } @@ -210,7 +210,7 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do context 'with group' do let!(:project) do - create(:empty_project, + create(:project, :builds_disabled, :issues_disabled, name: 'project', diff --git a/spec/lib/gitlab/import_export/relation_factory_spec.rb b/spec/lib/gitlab/import_export/relation_factory_spec.rb index baa90af84f7..f1df44cea75 100644 --- a/spec/lib/gitlab/import_export/relation_factory_spec.rb +++ b/spec/lib/gitlab/import_export/relation_factory_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Gitlab::ImportExport::RelationFactory do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:members_mapper) { double('members_mapper').as_null_object } let(:user) { create(:admin) } let(:created_object) do diff --git a/spec/lib/gitlab/import_export/repo_restorer_spec.rb b/spec/lib/gitlab/import_export/repo_restorer_spec.rb index d57833c3fec..2786bc92fe5 100644 --- a/spec/lib/gitlab/import_export/repo_restorer_spec.rb +++ b/spec/lib/gitlab/import_export/repo_restorer_spec.rb @@ -4,7 +4,7 @@ describe Gitlab::ImportExport::RepoRestorer do describe 'bundle a project Git repo' do let(:user) { create(:user) } let!(:project_with_repo) { create(:project, :repository, name: 'test-repo-restorer', path: 'test-repo-restorer') } - let!(:project) { create(:empty_project) } + let!(:project) { create(:project) } let(:export_path) { "#{Dir.tmpdir}/project_tree_saver_spec" } let(:shared) { Gitlab::ImportExport::Shared.new(relative_path: project.full_path) } let(:bundler) { Gitlab::ImportExport::RepoSaver.new(project: project_with_repo, shared: shared) } diff --git a/spec/lib/gitlab/import_export/repo_saver_spec.rb b/spec/lib/gitlab/import_export/repo_saver_spec.rb index 0ba199bbb05..e6ad516deef 100644 --- a/spec/lib/gitlab/import_export/repo_saver_spec.rb +++ b/spec/lib/gitlab/import_export/repo_saver_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Gitlab::ImportExport::RepoSaver do describe 'bundle a project Git repo' do let(:user) { create(:user) } - let!(:project) { create(:empty_project, :public, name: 'searchable_project') } + let!(:project) { create(:project, :public, name: 'searchable_project') } let(:export_path) { "#{Dir.tmpdir}/project_tree_saver_spec" } let(:shared) { Gitlab::ImportExport::Shared.new(relative_path: project.full_path) } let(:bundler) { described_class.new(project: project, shared: shared) } diff --git a/spec/lib/gitlab/import_export/wiki_repo_saver_spec.rb b/spec/lib/gitlab/import_export/wiki_repo_saver_spec.rb index caf08e674d3..0e55993c8ef 100644 --- a/spec/lib/gitlab/import_export/wiki_repo_saver_spec.rb +++ b/spec/lib/gitlab/import_export/wiki_repo_saver_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Gitlab::ImportExport::WikiRepoSaver do describe 'bundle a wiki Git repo' do let(:user) { create(:user) } - let!(:project) { create(:empty_project, :public, name: 'searchable_project') } + let!(:project) { create(:project, :public, name: 'searchable_project') } let(:export_path) { "#{Dir.tmpdir}/project_tree_saver_spec" } let(:shared) { Gitlab::ImportExport::Shared.new(relative_path: project.full_path) } let(:wiki_bundler) { described_class.new(project: project, shared: shared) } diff --git a/spec/lib/gitlab/issuable_sorter_spec.rb b/spec/lib/gitlab/issuable_sorter_spec.rb index c4138c063c8..642a6cb6caa 100644 --- a/spec/lib/gitlab/issuable_sorter_spec.rb +++ b/spec/lib/gitlab/issuable_sorter_spec.rb @@ -2,16 +2,16 @@ require 'spec_helper' describe Gitlab::IssuableSorter do let(:namespace1) { build_stubbed(:namespace, id: 1) } - let(:project1) { build_stubbed(:empty_project, id: 1, namespace: namespace1) } + let(:project1) { build_stubbed(:project, id: 1, namespace: namespace1) } - let(:project2) { build_stubbed(:empty_project, id: 2, path: "a", namespace: project1.namespace) } - let(:project3) { build_stubbed(:empty_project, id: 3, path: "b", namespace: project1.namespace) } + let(:project2) { build_stubbed(:project, id: 2, path: "a", namespace: project1.namespace) } + let(:project3) { build_stubbed(:project, id: 3, path: "b", namespace: project1.namespace) } let(:namespace2) { build_stubbed(:namespace, id: 2, path: "a") } let(:namespace3) { build_stubbed(:namespace, id: 3, path: "b") } - let(:project4) { build_stubbed(:empty_project, id: 4, path: "a", namespace: namespace2) } - let(:project5) { build_stubbed(:empty_project, id: 5, path: "b", namespace: namespace2) } - let(:project6) { build_stubbed(:empty_project, id: 6, path: "a", namespace: namespace3) } + let(:project4) { build_stubbed(:project, id: 4, path: "a", namespace: namespace2) } + let(:project5) { build_stubbed(:project, id: 5, path: "b", namespace: namespace2) } + let(:project6) { build_stubbed(:project, id: 6, path: "a", namespace: namespace3) } let(:unsorted) { [sorted[2], sorted[3], sorted[0], sorted[1]] } diff --git a/spec/lib/gitlab/middleware/go_spec.rb b/spec/lib/gitlab/middleware/go_spec.rb index de4c8b68ffa..6af1564da19 100644 --- a/spec/lib/gitlab/middleware/go_spec.rb +++ b/spec/lib/gitlab/middleware/go_spec.rb @@ -18,7 +18,7 @@ describe Gitlab::Middleware::Go do let(:current_user) { nil } context 'with simple 2-segment project path' do - let!(:project) { create(:empty_project, :private) } + let!(:project) { create(:project, :private) } context 'with subpackages' do let(:path) { "#{project.full_path}/subpackage" } @@ -39,7 +39,7 @@ describe Gitlab::Middleware::Go do context 'with a nested project path' do let(:group) { create(:group, :nested) } - let!(:project) { create(:empty_project, :public, namespace: group) } + let!(:project) { create(:project, :public, namespace: group) } shared_examples 'a nested project' do context 'when the project is public' do diff --git a/spec/lib/gitlab/project_authorizations_spec.rb b/spec/lib/gitlab/project_authorizations_spec.rb index 9ce33685697..953cfbb8b88 100644 --- a/spec/lib/gitlab/project_authorizations_spec.rb +++ b/spec/lib/gitlab/project_authorizations_spec.rb @@ -2,9 +2,9 @@ require 'spec_helper' describe Gitlab::ProjectAuthorizations do let(:group) { create(:group) } - let!(:owned_project) { create(:empty_project) } - let!(:other_project) { create(:empty_project) } - let!(:group_project) { create(:empty_project, namespace: group) } + let!(:owned_project) { create(:project) } + let!(:other_project) { create(:project) } + let!(:group_project) { create(:project, namespace: group) } let(:user) { owned_project.namespace.owner } @@ -49,7 +49,7 @@ describe Gitlab::ProjectAuthorizations do if Group.supports_nested_groups? context 'with nested groups' do let!(:nested_group) { create(:group, parent: group) } - let!(:nested_project) { create(:empty_project, namespace: nested_group) } + let!(:nested_project) { create(:project, namespace: nested_group) } it 'includes nested groups' do expect(authorizations.pluck(:project_id)).to include(nested_project.id) diff --git a/spec/lib/gitlab/project_search_results_spec.rb b/spec/lib/gitlab/project_search_results_spec.rb index 7851beb956b..9c3e7d7e9ba 100644 --- a/spec/lib/gitlab/project_search_results_spec.rb +++ b/spec/lib/gitlab/project_search_results_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Gitlab::ProjectSearchResults do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:query) { 'hello world' } describe 'initialize with empty ref' do @@ -100,14 +100,14 @@ describe Gitlab::ProjectSearchResults do end describe 'wiki search' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:wiki) { build(:project_wiki, project: project) } let!(:wiki_page) { wiki.create_page('Title', 'Content') } subject(:results) { described_class.new(user, project, 'Content').objects('wiki_blobs') } context 'when wiki is disabled' do - let(:project) { create(:empty_project, :public, :wiki_disabled) } + let(:project) { create(:project, :public, :wiki_disabled) } it 'hides wiki blobs from members' do project.add_reporter(user) @@ -121,7 +121,7 @@ describe Gitlab::ProjectSearchResults do end context 'when wiki is internal' do - let(:project) { create(:empty_project, :public, :wiki_private) } + let(:project) { create(:project, :public, :wiki_private) } it 'finds wiki blobs for guest' do project.add_guest(user) @@ -154,7 +154,7 @@ describe Gitlab::ProjectSearchResults do let(:non_member) { create(:user) } let(:member) { create(:user) } let(:admin) { create(:admin) } - let(:project) { create(:empty_project, :internal) } + let(:project) { create(:project, :internal) } let!(:issue) { create(:issue, project: project, title: 'Issue 1') } let!(:security_issue_1) { create(:issue, :confidential, project: project, title: 'Security issue 1', author: author) } let!(:security_issue_2) { create(:issue, :confidential, title: 'Security issue 2', project: project, assignees: [assignee]) } @@ -226,7 +226,7 @@ describe Gitlab::ProjectSearchResults do describe 'notes search' do it 'lists notes' do - project = create(:empty_project, :public) + project = create(:project, :public) note = create(:note, project: project) results = described_class.new(user, project, note.note) @@ -235,7 +235,7 @@ describe Gitlab::ProjectSearchResults do end it "doesn't list issue notes when access is restricted" do - project = create(:empty_project, :public, :issues_private) + project = create(:project, :public, :issues_private) note = create(:note_on_issue, project: project) results = described_class.new(user, project, note.note) @@ -244,7 +244,7 @@ describe Gitlab::ProjectSearchResults do end it "doesn't list merge_request notes when access is restricted" do - project = create(:empty_project, :public, :merge_requests_private) + project = create(:project, :public, :merge_requests_private) note = create(:note_on_merge_request, project: project) results = described_class.new(user, project, note.note) diff --git a/spec/lib/gitlab/reference_extractor_spec.rb b/spec/lib/gitlab/reference_extractor_spec.rb index 1a0357534f2..476a3f1998d 100644 --- a/spec/lib/gitlab/reference_extractor_spec.rb +++ b/spec/lib/gitlab/reference_extractor_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Gitlab::ReferenceExtractor do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } before do project.team << [project.creator, :developer] @@ -215,7 +215,7 @@ describe Gitlab::ReferenceExtractor do end context 'with a project with an underscore' do - let(:other_project) { create(:empty_project, path: 'test_project') } + let(:other_project) { create(:project, path: 'test_project') } let(:issue) { create(:issue, project: other_project) } before do diff --git a/spec/lib/gitlab/repo_path_spec.rb b/spec/lib/gitlab/repo_path_spec.rb index 6336f4a7125..1a925a15e0c 100644 --- a/spec/lib/gitlab/repo_path_spec.rb +++ b/spec/lib/gitlab/repo_path_spec.rb @@ -65,7 +65,7 @@ describe ::Gitlab::RepoPath do end describe '.find_project' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:redirect) { project.route.create_redirect('foo/bar/baz') } context 'when finding a project by its canonical path' do diff --git a/spec/lib/gitlab/search_results_spec.rb b/spec/lib/gitlab/search_results_spec.rb index 31c3cd4d53c..4c5efbde69a 100644 --- a/spec/lib/gitlab/search_results_spec.rb +++ b/spec/lib/gitlab/search_results_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Gitlab::SearchResults do let(:user) { create(:user) } - let!(:project) { create(:empty_project, name: 'foo') } + let!(:project) { create(:project, name: 'foo') } let!(:issue) { create(:issue, project: project, title: 'foo') } let!(:merge_request) do @@ -42,7 +42,7 @@ describe Gitlab::SearchResults do end it 'includes merge requests from source and target projects' do - forked_project = create(:empty_project, forked_from_project: project) + forked_project = create(:project, forked_from_project: project) merge_request_2 = create(:merge_request, target_project: project, source_project: forked_project, title: 'foo') results = described_class.new(user, Project.where(id: forked_project.id), 'foo') @@ -52,17 +52,17 @@ describe Gitlab::SearchResults do end it 'does not list issues on private projects' do - private_project = create(:empty_project, :private) + private_project = create(:project, :private) issue = create(:issue, project: private_project, title: 'foo') expect(results.objects('issues')).not_to include issue end describe 'confidential issues' do - let(:project_1) { create(:empty_project, :internal) } - let(:project_2) { create(:empty_project, :internal) } - let(:project_3) { create(:empty_project, :internal) } - let(:project_4) { create(:empty_project, :internal) } + let(:project_1) { create(:project, :internal) } + let(:project_2) { create(:project, :internal) } + let(:project_3) { create(:project, :internal) } + let(:project_4) { create(:project, :internal) } let(:query) { 'issue' } let(:limit_projects) { Project.where(id: [project_1.id, project_2.id, project_3.id]) } let(:author) { create(:user) } diff --git a/spec/lib/gitlab/slash_commands/command_spec.rb b/spec/lib/gitlab/slash_commands/command_spec.rb index 88f73bf90cd..0173a45d480 100644 --- a/spec/lib/gitlab/slash_commands/command_spec.rb +++ b/spec/lib/gitlab/slash_commands/command_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Gitlab::SlashCommands::Command do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } describe '#execute' do @@ -11,7 +11,7 @@ describe Gitlab::SlashCommands::Command do context 'when no command is available' do let(:params) { { text: 'issue show 1' } } - let(:project) { create(:empty_project, has_external_issue_tracker: true) } + let(:project) { create(:project, has_external_issue_tracker: true) } it 'displays 404 messages' do expect(subject[:response_type]).to be(:ephemeral) diff --git a/spec/lib/gitlab/slash_commands/deploy_spec.rb b/spec/lib/gitlab/slash_commands/deploy_spec.rb index c3fb7d5adea..74b5ef4bb26 100644 --- a/spec/lib/gitlab/slash_commands/deploy_spec.rb +++ b/spec/lib/gitlab/slash_commands/deploy_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Gitlab::SlashCommands::Deploy do describe '#execute' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } let(:regex_match) { described_class.match('deploy staging to production') } diff --git a/spec/lib/gitlab/slash_commands/issue_new_spec.rb b/spec/lib/gitlab/slash_commands/issue_new_spec.rb index 5dfb1b506bc..75ae58d0582 100644 --- a/spec/lib/gitlab/slash_commands/issue_new_spec.rb +++ b/spec/lib/gitlab/slash_commands/issue_new_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Gitlab::SlashCommands::IssueNew do describe '#execute' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } let(:regex_match) { described_class.match("issue create bird is the word") } diff --git a/spec/lib/gitlab/slash_commands/issue_search_spec.rb b/spec/lib/gitlab/slash_commands/issue_search_spec.rb index e5409fe2339..51f59216413 100644 --- a/spec/lib/gitlab/slash_commands/issue_search_spec.rb +++ b/spec/lib/gitlab/slash_commands/issue_search_spec.rb @@ -4,7 +4,7 @@ describe Gitlab::SlashCommands::IssueSearch do describe '#execute' do let!(:issue) { create(:issue, project: project, title: 'find me') } let!(:confidential) { create(:issue, :confidential, project: project, title: 'mepmep find') } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { issue.author } let(:regex_match) { described_class.match("issue search find") } diff --git a/spec/lib/gitlab/slash_commands/issue_show_spec.rb b/spec/lib/gitlab/slash_commands/issue_show_spec.rb index f67a17c7922..08c380ca8f1 100644 --- a/spec/lib/gitlab/slash_commands/issue_show_spec.rb +++ b/spec/lib/gitlab/slash_commands/issue_show_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Gitlab::SlashCommands::IssueShow do describe '#execute' do let(:issue) { create(:issue, project: project) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { issue.author } let(:regex_match) { described_class.match("issue show #{issue.iid}") } diff --git a/spec/lib/gitlab/slash_commands/presenters/issue_new_spec.rb b/spec/lib/gitlab/slash_commands/presenters/issue_new_spec.rb index 7f81ebb47db..76e4bad88fd 100644 --- a/spec/lib/gitlab/slash_commands/presenters/issue_new_spec.rb +++ b/spec/lib/gitlab/slash_commands/presenters/issue_new_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Gitlab::SlashCommands::Presenters::IssueNew do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:issue) { create(:issue, project: project) } let(:attachment) { subject[:attachments].first } diff --git a/spec/lib/gitlab/slash_commands/presenters/issue_search_spec.rb b/spec/lib/gitlab/slash_commands/presenters/issue_search_spec.rb index 7e57a0addcb..5a7ec0685fe 100644 --- a/spec/lib/gitlab/slash_commands/presenters/issue_search_spec.rb +++ b/spec/lib/gitlab/slash_commands/presenters/issue_search_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Gitlab::SlashCommands::Presenters::IssueSearch do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:message) { subject[:text] } before do diff --git a/spec/lib/gitlab/slash_commands/presenters/issue_show_spec.rb b/spec/lib/gitlab/slash_commands/presenters/issue_show_spec.rb index 2a6ed860737..8f607d7a9c9 100644 --- a/spec/lib/gitlab/slash_commands/presenters/issue_show_spec.rb +++ b/spec/lib/gitlab/slash_commands/presenters/issue_show_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Gitlab::SlashCommands::Presenters::IssueShow do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:issue) { create(:issue, project: project) } let(:attachment) { subject[:attachments].first } diff --git a/spec/lib/gitlab/template/issue_template_spec.rb b/spec/lib/gitlab/template/issue_template_spec.rb index bf45c8d16d6..6e0b1075a89 100644 --- a/spec/lib/gitlab/template/issue_template_spec.rb +++ b/spec/lib/gitlab/template/issue_template_spec.rb @@ -51,7 +51,7 @@ describe Gitlab::Template::IssueTemplate do end context 'when repo is bare or empty' do - let(:empty_project) { create(:empty_project) } + let(:empty_project) { create(:project) } before do empty_project.add_user(user, Gitlab::Access::MASTER) @@ -78,7 +78,7 @@ describe Gitlab::Template::IssueTemplate do end context "when repo is empty" do - let(:empty_project) { create(:empty_project) } + let(:empty_project) { create(:project) } before do empty_project.add_user(user, Gitlab::Access::MASTER) diff --git a/spec/lib/gitlab/template/merge_request_template_spec.rb b/spec/lib/gitlab/template/merge_request_template_spec.rb index 8479f92c8df..b952274cd24 100644 --- a/spec/lib/gitlab/template/merge_request_template_spec.rb +++ b/spec/lib/gitlab/template/merge_request_template_spec.rb @@ -51,7 +51,7 @@ describe Gitlab::Template::MergeRequestTemplate do end context 'when repo is bare or empty' do - let(:empty_project) { create(:empty_project) } + let(:empty_project) { create(:project) } before do empty_project.add_user(user, Gitlab::Access::MASTER) @@ -78,7 +78,7 @@ describe Gitlab::Template::MergeRequestTemplate do end context "when repo is empty" do - let(:empty_project) { create(:empty_project) } + let(:empty_project) { create(:project) } before do empty_project.add_user(user, Gitlab::Access::MASTER) diff --git a/spec/lib/gitlab/uploads_transfer_spec.rb b/spec/lib/gitlab/uploads_transfer_spec.rb index 109559bb01c..4275e7b015b 100644 --- a/spec/lib/gitlab/uploads_transfer_spec.rb +++ b/spec/lib/gitlab/uploads_transfer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Gitlab::UploadsTransfer do it 'leaves avatar uploads where they are' do - project_with_avatar = create(:empty_project, :with_avatar) + project_with_avatar = create(:project, :with_avatar) described_class.new.rename_namespace('project', 'project-renamed') diff --git a/spec/lib/gitlab/url_builder_spec.rb b/spec/lib/gitlab/url_builder_spec.rb index 7412f22640c..b81749cf428 100644 --- a/spec/lib/gitlab/url_builder_spec.rb +++ b/spec/lib/gitlab/url_builder_spec.rb @@ -110,7 +110,7 @@ describe Gitlab::UrlBuilder do context 'on another object' do it 'returns a proper URL' do - project = build_stubbed(:empty_project) + project = build_stubbed(:project) expect { described_class.build(project) } .to raise_error(NotImplementedError, 'No URL builder defined for Project') diff --git a/spec/lib/gitlab/view/presenter/base_spec.rb b/spec/lib/gitlab/view/presenter/base_spec.rb index f2c152cdcd4..32a946ca034 100644 --- a/spec/lib/gitlab/view/presenter/base_spec.rb +++ b/spec/lib/gitlab/view/presenter/base_spec.rb @@ -26,7 +26,7 @@ describe Gitlab::View::Presenter::Base do describe '#can?' do context 'user is not allowed' do it 'returns false' do - presenter = presenter_class.new(build_stubbed(:empty_project)) + presenter = presenter_class.new(build_stubbed(:project)) expect(presenter.can?(nil, :read_project)).to be_falsy end @@ -34,7 +34,7 @@ describe Gitlab::View::Presenter::Base do context 'user is allowed' do it 'returns true' do - presenter = presenter_class.new(build_stubbed(:empty_project, :public)) + presenter = presenter_class.new(build_stubbed(:project, :public)) expect(presenter.can?(nil, :read_project)).to be_truthy end @@ -42,9 +42,9 @@ describe Gitlab::View::Presenter::Base do context 'subject is overriden' do it 'returns true' do - presenter = presenter_class.new(build_stubbed(:empty_project, :public)) + presenter = presenter_class.new(build_stubbed(:project, :public)) - expect(presenter.can?(nil, :read_project, build_stubbed(:empty_project))).to be_falsy + expect(presenter.can?(nil, :read_project, build_stubbed(:project))).to be_falsy end end end diff --git a/spec/lib/repository_cache_spec.rb b/spec/lib/repository_cache_spec.rb index 0c15ba22bf2..8b0c7254b5e 100644 --- a/spec/lib/repository_cache_spec.rb +++ b/spec/lib/repository_cache_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe RepositoryCache do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:backend) { double('backend').as_null_object } let(:cache) { described_class.new('example', project.id, backend) } diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb index 683e893968b..e36d7a1800c 100644 --- a/spec/mailers/notify_spec.rb +++ b/spec/mailers/notify_spec.rb @@ -348,7 +348,7 @@ describe Notify do end describe 'project was moved' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } subject { described_class.project_was_moved_email(project.id, user.id, "gitlab/gitlab") } @@ -366,7 +366,7 @@ describe Notify do describe 'project access requested' do context 'for a project in a user namespace' do let(:project) do - create(:empty_project, :public, :access_requestable) do |project| + create(:project, :public, :access_requestable) do |project| project.team << [project.owner, :master, project.owner] end end @@ -397,7 +397,7 @@ describe Notify do context 'for a project in a group' do let(:group_owner) { create(:user) } let(:group) { create(:group).tap { |g| g.add_owner(group_owner) } } - let(:project) { create(:empty_project, :public, :access_requestable, namespace: group) } + let(:project) { create(:project, :public, :access_requestable, namespace: group) } let(:user) { create(:user) } let(:project_member) do project.request_access(user) @@ -423,7 +423,7 @@ describe Notify do end describe 'project access denied' do - let(:project) { create(:empty_project, :public, :access_requestable) } + let(:project) { create(:project, :public, :access_requestable) } let(:user) { create(:user) } let(:project_member) do project.request_access(user) @@ -444,7 +444,7 @@ describe Notify do describe 'project access changed' do let(:owner) { create(:user, name: "Chang O'Keefe") } - let(:project) { create(:empty_project, :public, :access_requestable, namespace: owner.namespace) } + let(:project) { create(:project, :public, :access_requestable, namespace: owner.namespace) } let(:user) { create(:user) } let(:project_member) { create(:project_member, project: project, user: user) } subject { described_class.member_access_granted_email('project', project_member.id) } @@ -474,7 +474,7 @@ describe Notify do end describe 'project invitation' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:master) { create(:user).tap { |u| project.team << [u, :master] } } let(:project_member) { invite_to_project(project, inviter: master) } @@ -494,7 +494,7 @@ describe Notify do end describe 'project invitation accepted' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:invited_user) { create(:user, name: 'invited user') } let(:master) { create(:user).tap { |u| project.team << [u, :master] } } let(:project_member) do @@ -519,7 +519,7 @@ describe Notify do end describe 'project invitation declined' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:master) { create(:user).tap { |u| project.team << [u, :master] } } let(:project_member) do invitee = invite_to_project(project, inviter: master) @@ -1242,7 +1242,7 @@ describe Notify do end describe 'HTML emails setting' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } let(:multipart_mail) { described_class.project_was_moved_email(project.id, user.id, "gitlab/gitlab") } diff --git a/spec/migrations/add_head_pipeline_for_each_merge_request_spec.rb b/spec/migrations/add_head_pipeline_for_each_merge_request_spec.rb index 65bea662b02..862907c5d01 100644 --- a/spec/migrations/add_head_pipeline_for_each_merge_request_spec.rb +++ b/spec/migrations/add_head_pipeline_for_each_merge_request_spec.rb @@ -4,7 +4,7 @@ require Rails.root.join('db', 'post_migrate', '20170508170547_add_head_pipeline_ describe AddHeadPipelineForEachMergeRequest, :truncate do let(:migration) { described_class.new } - let!(:project) { create(:empty_project) } + let!(:project) { create(:project) } let!(:forked_project_link) { create(:forked_project_link, forked_from_project: project) } let!(:other_project) { forked_project_link.forked_to_project } diff --git a/spec/migrations/cleanup_namespaceless_pending_delete_projects_spec.rb b/spec/migrations/cleanup_namespaceless_pending_delete_projects_spec.rb index dd634f2c024..12cac1d033d 100644 --- a/spec/migrations/cleanup_namespaceless_pending_delete_projects_spec.rb +++ b/spec/migrations/cleanup_namespaceless_pending_delete_projects_spec.rb @@ -10,9 +10,9 @@ describe CleanupNamespacelessPendingDeleteProjects do describe '#up' do it 'only cleans up pending delete projects' do - create(:empty_project) - create(:empty_project, pending_delete: true) - project = build(:empty_project, pending_delete: true, namespace_id: nil) + create(:project) + create(:project, pending_delete: true) + project = build(:project, pending_delete: true, namespace_id: nil) project.save(validate: false) expect(NamespacelessProjectDestroyWorker).to receive(:bulk_perform_async).with([[project.id]]) @@ -21,8 +21,8 @@ describe CleanupNamespacelessPendingDeleteProjects do end it 'does nothing when no pending delete projects without namespace found' do - create(:empty_project) - create(:empty_project, pending_delete: true) + create(:project) + create(:project, pending_delete: true) expect(NamespacelessProjectDestroyWorker).not_to receive(:bulk_perform_async) diff --git a/spec/migrations/fix_wrongly_renamed_routes_spec.rb b/spec/migrations/fix_wrongly_renamed_routes_spec.rb index 148290b0e7d..5ef10b92a3a 100644 --- a/spec/migrations/fix_wrongly_renamed_routes_spec.rb +++ b/spec/migrations/fix_wrongly_renamed_routes_spec.rb @@ -37,7 +37,7 @@ describe FixWronglyRenamedRoutes, truncate: true do describe '#routes_in_namespace_query' do it 'includes only the required routes' do namespace = create(:group, path: 'hello') - project = create(:empty_project, namespace: namespace) + project = create(:project, namespace: namespace) _other_namespace = create(:group, path: 'hello0') result = Route.where(subject.routes_in_namespace_query('hello')) @@ -48,7 +48,7 @@ describe FixWronglyRenamedRoutes, truncate: true do describe '#up' do let(:broken_project) do - project = create(:empty_project, namespace: broken_namespace, path: 'broken-project') + project = create(:project, namespace: broken_namespace, path: 'broken-project') project.route.update_attribute(:path, 'api0is/broken-project') project end diff --git a/spec/migrations/migrate_old_artifacts_spec.rb b/spec/migrations/migrate_old_artifacts_spec.rb index 50f4bbda001..cfe1ca481b2 100644 --- a/spec/migrations/migrate_old_artifacts_spec.rb +++ b/spec/migrations/migrate_old_artifacts_spec.rb @@ -16,9 +16,9 @@ describe MigrateOldArtifacts do end context 'with migratable data' do - let(:project1) { create(:empty_project, ci_id: 2) } - let(:project2) { create(:empty_project, ci_id: 3) } - let(:project3) { create(:empty_project) } + let(:project1) { create(:project, ci_id: 2) } + let(:project2) { create(:project, ci_id: 3) } + let(:project3) { create(:project) } let(:pipeline1) { create(:ci_empty_pipeline, project: project1) } let(:pipeline2) { create(:ci_empty_pipeline, project: project2) } diff --git a/spec/migrations/rename_more_reserved_project_names_spec.rb b/spec/migrations/rename_more_reserved_project_names_spec.rb index 4bd8d4ac0d1..ae3a4cb9b29 100644 --- a/spec/migrations/rename_more_reserved_project_names_spec.rb +++ b/spec/migrations/rename_more_reserved_project_names_spec.rb @@ -8,7 +8,7 @@ require Rails.root.join('db', 'post_migrate', '20170313133418_rename_more_reserv # around this we use the TRUNCATE cleaning strategy. describe RenameMoreReservedProjectNames, truncate: true do let(:migration) { described_class.new } - let!(:project) { create(:empty_project) } + let!(:project) { create(:project) } before do project.path = 'artifacts' diff --git a/spec/migrations/rename_reserved_project_names_spec.rb b/spec/migrations/rename_reserved_project_names_spec.rb index 05e021c2e32..462f4c08d63 100644 --- a/spec/migrations/rename_reserved_project_names_spec.rb +++ b/spec/migrations/rename_reserved_project_names_spec.rb @@ -8,7 +8,7 @@ require Rails.root.join('db', 'post_migrate', '20161221153951_rename_reserved_pr # around this we use the TRUNCATE cleaning strategy. describe RenameReservedProjectNames, truncate: true do let(:migration) { described_class.new } - let!(:project) { create(:empty_project) } + let!(:project) { create(:project) } before do project.path = 'projects' diff --git a/spec/migrations/update_upload_paths_to_system_spec.rb b/spec/migrations/update_upload_paths_to_system_spec.rb index 7df44515424..11412005b72 100644 --- a/spec/migrations/update_upload_paths_to_system_spec.rb +++ b/spec/migrations/update_upload_paths_to_system_spec.rb @@ -11,9 +11,9 @@ describe UpdateUploadPathsToSystem do describe "#uploads_to_switch_to_new_path" do it "contains only uploads with the old path for the correct models" do _upload_for_other_type = create(:upload, model: create(:ci_pipeline), path: "uploads/ci_pipeline/avatar.jpg") - _upload_with_system_path = create(:upload, model: create(:empty_project), path: "uploads/system/project/avatar.jpg") - _upload_with_other_path = create(:upload, model: create(:empty_project), path: "thelongsecretforafileupload/avatar.jpg") - old_upload = create(:upload, model: create(:empty_project), path: "uploads/project/avatar.jpg") + _upload_with_system_path = create(:upload, model: create(:project), path: "uploads/system/project/avatar.jpg") + _upload_with_other_path = create(:upload, model: create(:project), path: "thelongsecretforafileupload/avatar.jpg") + old_upload = create(:upload, model: create(:project), path: "uploads/project/avatar.jpg") group_upload = create(:upload, model: create(:group), path: "uploads/group/avatar.jpg") expect(Upload.where(migration.uploads_to_switch_to_new_path)).to contain_exactly(old_upload, group_upload) @@ -23,9 +23,9 @@ describe UpdateUploadPathsToSystem do describe "#uploads_to_switch_to_old_path" do it "contains only uploads with the new path for the correct models" do _upload_for_other_type = create(:upload, model: create(:ci_pipeline), path: "uploads/ci_pipeline/avatar.jpg") - upload_with_system_path = create(:upload, model: create(:empty_project), path: "uploads/system/project/avatar.jpg") - _upload_with_other_path = create(:upload, model: create(:empty_project), path: "thelongsecretforafileupload/avatar.jpg") - _old_upload = create(:upload, model: create(:empty_project), path: "uploads/project/avatar.jpg") + upload_with_system_path = create(:upload, model: create(:project), path: "uploads/system/project/avatar.jpg") + _upload_with_other_path = create(:upload, model: create(:project), path: "thelongsecretforafileupload/avatar.jpg") + _old_upload = create(:upload, model: create(:project), path: "uploads/project/avatar.jpg") expect(Upload.where(migration.uploads_to_switch_to_old_path)).to contain_exactly(upload_with_system_path) end @@ -33,7 +33,7 @@ describe UpdateUploadPathsToSystem do describe "#up", truncate: true do it "updates old upload records to the new path" do - old_upload = create(:upload, model: create(:empty_project), path: "uploads/project/avatar.jpg") + old_upload = create(:upload, model: create(:project), path: "uploads/project/avatar.jpg") migration.up @@ -43,7 +43,7 @@ describe UpdateUploadPathsToSystem do describe "#down", truncate: true do it "updates the new system patsh to the old paths" do - new_upload = create(:upload, model: create(:empty_project), path: "uploads/system/project/avatar.jpg") + new_upload = create(:upload, model: create(:project), path: "uploads/system/project/avatar.jpg") migration.down diff --git a/spec/models/ability_spec.rb b/spec/models/ability_spec.rb index aa019288700..71aa51e1857 100644 --- a/spec/models/ability_spec.rb +++ b/spec/models/ability_spec.rb @@ -8,7 +8,7 @@ describe Ability do end describe '.can_edit_note?' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:note) { create(:note_on_issue, project: project) } context 'using an anonymous user' do @@ -66,7 +66,7 @@ describe Ability do describe '.users_that_can_read_project' do context 'using a public project' do it 'returns all the users' do - project = create(:empty_project, :public) + project = create(:project, :public) user = build(:user) expect(described_class.users_that_can_read_project([user], project)) @@ -75,7 +75,7 @@ describe Ability do end context 'using an internal project' do - let(:project) { create(:empty_project, :internal) } + let(:project) { create(:project, :internal) } it 'returns users that are administrators' do user = build(:user, admin: true) @@ -126,7 +126,7 @@ describe Ability do end context 'using a private project' do - let(:project) { create(:empty_project, :private) } + let(:project) { create(:project, :private) } it 'returns users that are administrators' do user = build(:user, admin: true) @@ -253,7 +253,7 @@ describe Ability do end describe '.project_disabled_features_rules' do - let(:project) { create(:empty_project, :wiki_disabled) } + let(:project) { create(:project, :wiki_disabled) } subject { described_class.policy_for(project.owner, project) } diff --git a/spec/models/blob_spec.rb b/spec/models/blob_spec.rb index e1193e0d19a..47342f98283 100644 --- a/spec/models/blob_spec.rb +++ b/spec/models/blob_spec.rb @@ -4,7 +4,7 @@ require 'rails_helper' describe Blob do include FakeBlobHelpers - let(:project) { build(:empty_project, lfs_enabled: true) } + let(:project) { build(:project, lfs_enabled: true) } before do allow(Gitlab.config.lfs).to receive(:enabled).and_return(true) diff --git a/spec/models/blob_viewer/base_spec.rb b/spec/models/blob_viewer/base_spec.rb index e3640097dff..7ba28f72215 100644 --- a/spec/models/blob_viewer/base_spec.rb +++ b/spec/models/blob_viewer/base_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe BlobViewer::Base do include FakeBlobHelpers - let(:project) { build(:empty_project) } + let(:project) { build(:project) } let(:viewer_class) do Class.new(described_class) do diff --git a/spec/models/blob_viewer/composer_json_spec.rb b/spec/models/blob_viewer/composer_json_spec.rb index 35e7e1805d4..85b0d9668a0 100644 --- a/spec/models/blob_viewer/composer_json_spec.rb +++ b/spec/models/blob_viewer/composer_json_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe BlobViewer::ComposerJson do include FakeBlobHelpers - let(:project) { build_stubbed(:empty_project) } + let(:project) { build_stubbed(:project) } let(:data) do <<-SPEC.strip_heredoc { diff --git a/spec/models/blob_viewer/gemspec_spec.rb b/spec/models/blob_viewer/gemspec_spec.rb index 5406ff552f8..d8c4490637f 100644 --- a/spec/models/blob_viewer/gemspec_spec.rb +++ b/spec/models/blob_viewer/gemspec_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe BlobViewer::Gemspec do include FakeBlobHelpers - let(:project) { build_stubbed(:empty_project) } + let(:project) { build_stubbed(:project) } let(:data) do <<-SPEC.strip_heredoc Gem::Specification.new do |s| diff --git a/spec/models/blob_viewer/gitlab_ci_yml_spec.rb b/spec/models/blob_viewer/gitlab_ci_yml_spec.rb index 344fcdeb9b6..bed364a8c14 100644 --- a/spec/models/blob_viewer/gitlab_ci_yml_spec.rb +++ b/spec/models/blob_viewer/gitlab_ci_yml_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe BlobViewer::GitlabCiYml do include FakeBlobHelpers - let(:project) { build_stubbed(:empty_project) } + let(:project) { build_stubbed(:project) } let(:data) { File.read(Rails.root.join('spec/support/gitlab_stubs/gitlab_ci.yml')) } let(:blob) { fake_blob(path: '.gitlab-ci.yml', data: data) } subject { described_class.new(blob) } diff --git a/spec/models/blob_viewer/package_json_spec.rb b/spec/models/blob_viewer/package_json_spec.rb index 976c2ed3639..0f8330e91c1 100644 --- a/spec/models/blob_viewer/package_json_spec.rb +++ b/spec/models/blob_viewer/package_json_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe BlobViewer::PackageJson do include FakeBlobHelpers - let(:project) { build_stubbed(:empty_project) } + let(:project) { build_stubbed(:project) } let(:data) do <<-SPEC.strip_heredoc { diff --git a/spec/models/blob_viewer/podspec_json_spec.rb b/spec/models/blob_viewer/podspec_json_spec.rb index b98360ea7b7..9a23877b23f 100644 --- a/spec/models/blob_viewer/podspec_json_spec.rb +++ b/spec/models/blob_viewer/podspec_json_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe BlobViewer::PodspecJson do include FakeBlobHelpers - let(:project) { build_stubbed(:empty_project) } + let(:project) { build_stubbed(:project) } let(:data) do <<-SPEC.strip_heredoc { diff --git a/spec/models/blob_viewer/podspec_spec.rb b/spec/models/blob_viewer/podspec_spec.rb index ad2bbe034ea..02d06ea24d6 100644 --- a/spec/models/blob_viewer/podspec_spec.rb +++ b/spec/models/blob_viewer/podspec_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe BlobViewer::Podspec do include FakeBlobHelpers - let(:project) { build_stubbed(:empty_project) } + let(:project) { build_stubbed(:project) } let(:data) do <<-SPEC.strip_heredoc Pod::Spec.new do |spec| diff --git a/spec/models/blob_viewer/route_map_spec.rb b/spec/models/blob_viewer/route_map_spec.rb index 12b6519a344..c13662427b0 100644 --- a/spec/models/blob_viewer/route_map_spec.rb +++ b/spec/models/blob_viewer/route_map_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe BlobViewer::RouteMap do include FakeBlobHelpers - let(:project) { build_stubbed(:empty_project) } + let(:project) { build_stubbed(:project) } let(:data) do <<-MAP.strip_heredoc # Team data diff --git a/spec/models/blob_viewer/server_side_spec.rb b/spec/models/blob_viewer/server_side_spec.rb index 2639eec9e84..63790486200 100644 --- a/spec/models/blob_viewer/server_side_spec.rb +++ b/spec/models/blob_viewer/server_side_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe BlobViewer::ServerSide do include FakeBlobHelpers - let(:project) { build(:empty_project) } + let(:project) { build(:project) } let(:viewer_class) do Class.new(BlobViewer::Base) do @@ -25,7 +25,7 @@ describe BlobViewer::ServerSide do describe '#render_error' do context 'when the blob is stored externally' do - let(:project) { build(:empty_project, lfs_enabled: true) } + let(:project) { build(:project, lfs_enabled: true) } let(:blob) { fake_blob(path: 'file.pdf', lfs: true) } diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb index b0efa689a07..f63ff19c2fc 100644 --- a/spec/models/ci/pipeline_spec.rb +++ b/spec/models/ci/pipeline_spec.rb @@ -4,7 +4,7 @@ describe Ci::Pipeline do include EmailHelpers let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:pipeline) do create(:ci_empty_pipeline, status: :created, project: project) @@ -93,7 +93,7 @@ describe Ci::Pipeline do end describe "coverage" do - let(:project) { create(:empty_project, build_coverage_regex: "/.*/") } + let(:project) { create(:project, build_coverage_regex: "/.*/") } let(:pipeline) { create(:ci_empty_pipeline, project: project) } it "calculates average when there are two builds with coverage" do @@ -1147,7 +1147,7 @@ describe Ci::Pipeline do end describe "#merge_requests" do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:pipeline) { create(:ci_empty_pipeline, status: 'created', project: project, ref: 'master', sha: 'a288a022a53a5a944fae87bcec6efc87b7061808') } it "returns merge requests whose `diff_head_sha` matches the pipeline's SHA" do @@ -1172,7 +1172,7 @@ describe Ci::Pipeline do end describe "#all_merge_requests" do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:pipeline) { create(:ci_empty_pipeline, status: 'created', project: project, ref: 'master') } it "returns all merge requests having the same source branch" do diff --git a/spec/models/ci/runner_spec.rb b/spec/models/ci/runner_spec.rb index 8d12a9c09ca..48f878bbee6 100644 --- a/spec/models/ci/runner_spec.rb +++ b/spec/models/ci/runner_spec.rb @@ -37,7 +37,7 @@ describe Ci::Runner do end describe '#assign_to' do - let!(:project) { FactoryGirl.create :empty_project } + let!(:project) { FactoryGirl.create :project } let!(:shared_runner) { FactoryGirl.create(:ci_runner, :shared) } before do @@ -339,8 +339,8 @@ describe Ci::Runner do describe '.assignable_for' do let(:runner) { create(:ci_runner) } - let(:project) { create(:empty_project) } - let(:another_project) { create(:empty_project) } + let(:project) { create(:project) } + let(:another_project) { create(:project) } before do project.runners << runner @@ -400,8 +400,8 @@ describe Ci::Runner do describe "belongs_to_one_project?" do it "returns false if there are two projects runner assigned to" do runner = FactoryGirl.create(:ci_runner) - project = FactoryGirl.create(:empty_project) - project1 = FactoryGirl.create(:empty_project) + project = FactoryGirl.create(:project) + project1 = FactoryGirl.create(:project) project.runners << runner project1.runners << runner @@ -410,7 +410,7 @@ describe Ci::Runner do it "returns true" do runner = FactoryGirl.create(:ci_runner) - project = FactoryGirl.create(:empty_project) + project = FactoryGirl.create(:project) project.runners << runner expect(runner.belongs_to_one_project?).to be_truthy diff --git a/spec/models/ci/trigger_spec.rb b/spec/models/ci/trigger_spec.rb index de51f4879fd..bd9c837402f 100644 --- a/spec/models/ci/trigger_spec.rb +++ b/spec/models/ci/trigger_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Ci::Trigger do - let(:project) { create :empty_project } + let(:project) { create :project } describe 'associations' do it { is_expected.to belong_to(:project) } diff --git a/spec/models/commit_range_spec.rb b/spec/models/commit_range_spec.rb index 07e10b44938..38829773599 100644 --- a/spec/models/commit_range_spec.rb +++ b/spec/models/commit_range_spec.rb @@ -45,7 +45,7 @@ describe CommitRange do end describe '#to_reference' do - let(:cross) { create(:empty_project, namespace: project.namespace) } + let(:cross) { create(:project, namespace: project.namespace) } it 'returns a String reference to the object' do expect(range.to_reference).to eq "#{full_sha_from}...#{full_sha_to}" @@ -61,7 +61,7 @@ describe CommitRange do end describe '#reference_link_text' do - let(:cross) { create(:empty_project, namespace: project.namespace) } + let(:cross) { create(:project, namespace: project.namespace) } it 'returns a String reference to the object' do expect(range.reference_link_text).to eq "#{sha_from}...#{sha_to}" diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb index 595c54890ab..08693b5da33 100644 --- a/spec/models/commit_spec.rb +++ b/spec/models/commit_spec.rb @@ -151,7 +151,7 @@ eos describe '#closes_issues' do let(:issue) { create :issue, project: project } - let(:other_project) { create(:empty_project, :public) } + let(:other_project) { create(:project, :public) } let(:other_issue) { create :issue, project: other_project } let(:commiter) { create :user } diff --git a/spec/models/concerns/access_requestable_spec.rb b/spec/models/concerns/access_requestable_spec.rb index 97b7e48bb3c..04d6cfa2c02 100644 --- a/spec/models/concerns/access_requestable_spec.rb +++ b/spec/models/concerns/access_requestable_spec.rb @@ -24,14 +24,14 @@ describe AccessRequestable do describe 'Project' do describe '#request_access' do - let(:project) { create(:empty_project, :public, :access_requestable) } + let(:project) { create(:project, :public, :access_requestable) } let(:user) { create(:user) } it { expect(project.request_access(user)).to be_a(ProjectMember) } end describe '#access_requested?' do - let(:project) { create(:empty_project, :public, :access_requestable) } + let(:project) { create(:project, :public, :access_requestable) } let(:user) { create(:user) } before do diff --git a/spec/models/concerns/issuable_spec.rb b/spec/models/concerns/issuable_spec.rb index 505039c9d88..0137f71be8f 100644 --- a/spec/models/concerns/issuable_spec.rb +++ b/spec/models/concerns/issuable_spec.rb @@ -155,7 +155,7 @@ describe Issuable do end describe "#sort" do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } context "by milestone due date" do # Correct order is: @@ -296,7 +296,7 @@ describe Issuable do end describe '#labels_array' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:bug) { create(:label, project: project, title: 'bug') } let(:issue) { create(:issue, project: project) } @@ -310,7 +310,7 @@ describe Issuable do end describe '#user_notes_count' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:issue1) { create(:issue, project: project) } let(:issue2) { create(:issue, project: project) } @@ -340,7 +340,7 @@ describe Issuable do end describe '.order_due_date_and_labels_priority' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } def create_issue(milestone, labels) create(:labeled_issue, milestone: milestone, labels: labels, project: project) @@ -394,7 +394,7 @@ describe Issuable do end describe ".with_label" do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:bug) { create(:label, project: project, title: 'bug') } let(:feature) { create(:label, project: project, title: 'feature') } let(:enhancement) { create(:label, project: project, title: 'enhancement') } diff --git a/spec/models/concerns/mentionable_spec.rb b/spec/models/concerns/mentionable_spec.rb index 1ad811736af..8b545aec7f5 100644 --- a/spec/models/concerns/mentionable_spec.rb +++ b/spec/models/concerns/mentionable_spec.rb @@ -13,7 +13,7 @@ describe Mentionable do end describe 'references' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:mentionable) { Example.new } it 'excludes JIRA references' do @@ -48,10 +48,10 @@ describe Issue, "Mentionable" do describe '#referenced_mentionables' do context 'with an issue on a private project' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:issue) { create(:issue, project: project) } let(:public_issue) { create(:issue, project: project) } - let(:private_project) { create(:empty_project, :private) } + let(:private_project) { create(:project, :private) } let(:private_issue) { create(:issue, project: private_project) } let(:user) { create(:user) } @@ -102,7 +102,7 @@ describe Issue, "Mentionable" do end describe '#create_new_cross_references!' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:author) { create(:author) } let(:issues) { create_list(:issue, 2, project: project, author: author) } @@ -204,7 +204,7 @@ describe Commit, 'Mentionable' do end context 'with external issue tracker' do - let(:project) { create(:jira_project) } + let(:project) { create(:jira_project, :repository) } it 'is true if external issues referenced' do allow(commit.raw).to receive(:message).and_return 'JIRA-123' diff --git a/spec/models/concerns/milestoneish_spec.rb b/spec/models/concerns/milestoneish_spec.rb index cefe7fb6fea..66353935427 100644 --- a/spec/models/concerns/milestoneish_spec.rb +++ b/spec/models/concerns/milestoneish_spec.rb @@ -7,7 +7,7 @@ describe Milestone, 'Milestoneish' do let(:member) { create(:user) } let(:guest) { create(:user) } let(:admin) { create(:admin) } - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:milestone) { create(:milestone, project: project) } let!(:issue) { create(:issue, project: project, milestone: milestone) } let!(:security_issue_1) { create(:issue, :confidential, project: project, author: author, milestone: milestone) } diff --git a/spec/models/concerns/participable_spec.rb b/spec/models/concerns/participable_spec.rb index 6c4b5a9e9d6..431f1482615 100644 --- a/spec/models/concerns/participable_spec.rb +++ b/spec/models/concerns/participable_spec.rb @@ -24,7 +24,7 @@ describe Participable do user1 = build(:user) user2 = build(:user) user3 = build(:user) - project = build(:empty_project, :public) + project = build(:project, :public) instance = model.new expect(instance).to receive(:foo).and_return(user2) @@ -57,7 +57,7 @@ describe Participable do other = other_model.new user1 = build(:user) user2 = build(:user) - project = build(:empty_project, :public) + project = build(:project, :public) expect(instance).to receive(:foo).and_return(other) expect(other).to receive(:bar).and_return(user2) @@ -69,7 +69,7 @@ describe Participable do context 'when using a Proc as an attribute' do it 'calls the supplied Proc' do user1 = build(:user) - project = build(:empty_project, :public) + project = build(:project, :public) user_arg = nil ext_arg = nil diff --git a/spec/models/concerns/project_features_compatibility_spec.rb b/spec/models/concerns/project_features_compatibility_spec.rb index 6cf5877424d..9041690023f 100644 --- a/spec/models/concerns/project_features_compatibility_spec.rb +++ b/spec/models/concerns/project_features_compatibility_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe ProjectFeaturesCompatibility do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:features) { %w(issues wiki builds merge_requests snippets) } # We had issues_enabled, snippets_enabled, builds_enabled, merge_requests_enabled and issues_enabled fields on projects table diff --git a/spec/models/concerns/relative_positioning_spec.rb b/spec/models/concerns/relative_positioning_spec.rb index 494e6f1b6f6..729056b6abc 100644 --- a/spec/models/concerns/relative_positioning_spec.rb +++ b/spec/models/concerns/relative_positioning_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe RelativePositioning do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:issue) { create(:issue, project: project) } let(:issue1) { create(:issue, project: project) } let(:new_issue) { create(:issue, project: project) } diff --git a/spec/models/concerns/routable_spec.rb b/spec/models/concerns/routable_spec.rb index 866a835d62a..b463d12e448 100644 --- a/spec/models/concerns/routable_spec.rb +++ b/spec/models/concerns/routable_spec.rb @@ -27,7 +27,7 @@ describe Group, 'Routable' do it 'ensure route path uniqueness across different objects' do create(:group, parent: group, path: 'xyz') - duplicate = build(:empty_project, namespace: group, path: 'xyz') + duplicate = build(:project, namespace: group, path: 'xyz') expect { duplicate.save! }.to raise_error(ActiveRecord::RecordInvalid, 'Validation failed: Route path has already been taken, Route is invalid') end @@ -156,13 +156,13 @@ end describe Project, 'Routable' do describe '#full_path' do - let(:project) { build_stubbed(:empty_project) } + let(:project) { build_stubbed(:project) } it { expect(project.full_path).to eq "#{project.namespace.full_path}/#{project.path}" } end describe '#full_name' do - let(:project) { build_stubbed(:empty_project) } + let(:project) { build_stubbed(:project) } it { expect(project.full_name).to eq "#{project.namespace.human_name} / #{project.name}" } end diff --git a/spec/models/concerns/subscribable_spec.rb b/spec/models/concerns/subscribable_spec.rb index 58f5c164116..28ff8158e0e 100644 --- a/spec/models/concerns/subscribable_spec.rb +++ b/spec/models/concerns/subscribable_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Subscribable, 'Subscribable' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:resource) { create(:issue, project: project) } let(:user_1) { create(:user) } diff --git a/spec/models/deploy_keys_project_spec.rb b/spec/models/deploy_keys_project_spec.rb index f10b65ba9d8..0345fefb254 100644 --- a/spec/models/deploy_keys_project_spec.rb +++ b/spec/models/deploy_keys_project_spec.rb @@ -12,7 +12,7 @@ describe DeployKeysProject do end describe "Destroying" do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } subject { create(:deploy_keys_project, project: project) } let(:deploy_key) { subject.deploy_key } @@ -39,7 +39,7 @@ describe DeployKeysProject do end context "when the deploy key is used by more than one project" do - let!(:other_project) { create(:empty_project) } + let!(:other_project) { create(:project) } before do other_project.deploy_keys << deploy_key diff --git a/spec/models/environment_spec.rb b/spec/models/environment_spec.rb index 9a35213c98d..ea8512a5eae 100644 --- a/spec/models/environment_spec.rb +++ b/spec/models/environment_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Environment do - set(:project) { create(:empty_project) } + set(:project) { create(:project) } subject(:environment) { create(:environment, project: project) } it { is_expected.to belong_to(:project) } diff --git a/spec/models/event_spec.rb b/spec/models/event_spec.rb index 4a4b84c9566..d86bf1a90a9 100644 --- a/spec/models/event_spec.rb +++ b/spec/models/event_spec.rb @@ -15,7 +15,7 @@ describe Event do end describe 'Callbacks' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } describe 'after_create :reset_project_activity' do it 'calls the reset_project_activity method' do @@ -53,7 +53,7 @@ describe Event do end describe "Push event" do - let(:project) { create(:empty_project, :private) } + let(:project) { create(:project, :private) } let(:user) { project.owner } let(:event) { create_push_event(project, user) } @@ -111,7 +111,7 @@ describe Event do end describe '#visible_to_user?' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:non_member) { create(:user) } let(:member) { create(:user) } let(:guest) { create(:user) } @@ -143,7 +143,7 @@ describe Event do end context 'private project' do - let(:project) { create(:empty_project, :private) } + let(:project) { create(:project, :private) } it do aggregate_failures do @@ -213,7 +213,7 @@ describe Event do end context 'merge request diff note event' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:merge_request) { create(:merge_request, source_project: project, author: author, assignee: assignee) } let(:note_on_merge_request) { create(:legacy_diff_note_on_merge_request, noteable: merge_request, project: project) } let(:target) { note_on_merge_request } @@ -228,7 +228,7 @@ describe Event do end context 'private project' do - let(:project) { create(:empty_project, :private) } + let(:project) { create(:project, :private) } it do expect(event.visible_to_user?(non_member)).to eq false @@ -260,7 +260,7 @@ describe Event do end describe '#reset_project_activity' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } context 'when a project was updated less than 1 hour ago' do it 'does not update the project' do diff --git a/spec/models/generic_commit_status_spec.rb b/spec/models/generic_commit_status_spec.rb index aedc74deb78..7f1909710d8 100644 --- a/spec/models/generic_commit_status_spec.rb +++ b/spec/models/generic_commit_status_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe GenericCommitStatus do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:pipeline) { create(:ci_pipeline, project: project) } let(:external_url) { 'http://example.gitlab.com/status' } diff --git a/spec/models/global_milestone_spec.rb b/spec/models/global_milestone_spec.rb index 5584a1a5a31..ab58f5c5021 100644 --- a/spec/models/global_milestone_spec.rb +++ b/spec/models/global_milestone_spec.rb @@ -4,9 +4,9 @@ describe GlobalMilestone do let(:user) { create(:user) } let(:user2) { create(:user) } let(:group) { create(:group) } - let(:project1) { create(:empty_project, group: group) } - let(:project2) { create(:empty_project, path: 'gitlab-ci', group: group) } - let(:project3) { create(:empty_project, path: 'cookbook-gitlab', group: group) } + let(:project1) { create(:project, group: group) } + let(:project2) { create(:project, path: 'gitlab-ci', group: group) } + let(:project3) { create(:project, path: 'cookbook-gitlab', group: group) } describe '.build_collection' do let(:milestone1_due_date) { 2.weeks.from_now.to_date } diff --git a/spec/models/group_label_spec.rb b/spec/models/group_label_spec.rb index f7828059295..d0fc1eaa3ec 100644 --- a/spec/models/group_label_spec.rb +++ b/spec/models/group_label_spec.rb @@ -39,8 +39,8 @@ describe GroupLabel do context 'cross-project' do let(:namespace) { build_stubbed(:namespace) } - let(:source_project) { build_stubbed(:empty_project, name: 'project-1', namespace: namespace) } - let(:target_project) { build_stubbed(:empty_project, name: 'project-2', namespace: namespace) } + let(:source_project) { build_stubbed(:project, name: 'project-1', namespace: namespace) } + let(:target_project) { build_stubbed(:project, name: 'project-2', namespace: namespace) } it 'returns a String reference to the object' do expect(label.to_reference(source_project, target_project: target_project)).to eq %(project-1~#{label.id}) diff --git a/spec/models/group_milestone_spec.rb b/spec/models/group_milestone_spec.rb index ac76c927c39..b60676afc91 100644 --- a/spec/models/group_milestone_spec.rb +++ b/spec/models/group_milestone_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe GroupMilestone do let(:group) { create(:group) } - let(:project) { create(:empty_project, group: group) } + let(:project) { create(:project, group: group) } let(:project_milestone) do create(:milestone, title: "Milestone v1.2", project: project) end diff --git a/spec/models/group_spec.rb b/spec/models/group_spec.rb index 112bd605a64..c5bfae47606 100644 --- a/spec/models/group_spec.rb +++ b/spec/models/group_spec.rb @@ -425,7 +425,7 @@ describe Group do end describe '#secret_variables_for' do - let(:project) { create(:empty_project, group: group) } + let(:project) { create(:project, group: group) } let!(:secret_variable) do create(:ci_group_variable, value: 'secret', group: group) diff --git a/spec/models/guest_spec.rb b/spec/models/guest_spec.rb index 0e9b94aac97..2afdd6751a4 100644 --- a/spec/models/guest_spec.rb +++ b/spec/models/guest_spec.rb @@ -1,9 +1,9 @@ require 'spec_helper' describe Guest do - let(:public_project) { build_stubbed(:empty_project, :public) } - let(:private_project) { build_stubbed(:empty_project, :private) } - let(:internal_project) { build_stubbed(:empty_project, :internal) } + let(:public_project) { build_stubbed(:project, :public) } + let(:private_project) { build_stubbed(:project, :private) } + let(:internal_project) { build_stubbed(:project, :internal) } describe '.can_pull?' do context 'when project is private' do diff --git a/spec/models/hooks/system_hook_spec.rb b/spec/models/hooks/system_hook_spec.rb index eadc232a989..431e3db9f00 100644 --- a/spec/models/hooks/system_hook_spec.rb +++ b/spec/models/hooks/system_hook_spec.rb @@ -16,7 +16,7 @@ describe SystemHook do describe "execute" do let(:system_hook) { create(:system_hook) } let(:user) { create(:user) } - let(:project) { create(:empty_project, namespace: user.namespace) } + let(:project) { create(:project, namespace: user.namespace) } let(:group) { create(:group) } let(:params) do { name: 'John Doe', username: 'jduser', email: 'jg@example.com', password: 'mydummypass' } diff --git a/spec/models/issue/metrics_spec.rb b/spec/models/issue/metrics_spec.rb index 6ceff7d24d4..1bf0ecb98ad 100644 --- a/spec/models/issue/metrics_spec.rb +++ b/spec/models/issue/metrics_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Issue::Metrics do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } subject { create(:issue, project: project) } diff --git a/spec/models/issue_collection_spec.rb b/spec/models/issue_collection_spec.rb index 04d23d4c4fd..34d98a3c975 100644 --- a/spec/models/issue_collection_spec.rb +++ b/spec/models/issue_collection_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe IssueCollection do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:issue1) { create(:issue, project: project) } let(:issue2) { create(:issue, project: project) } let(:collection) { described_class.new([issue1, issue2]) } diff --git a/spec/models/issue_spec.rb b/spec/models/issue_spec.rb index eaf06668327..fa22eee3dea 100644 --- a/spec/models/issue_spec.rb +++ b/spec/models/issue_spec.rb @@ -24,7 +24,7 @@ describe Issue do end describe '#order_by_position_and_priority' do - let(:project) { create :empty_project } + let(:project) { create :project } let(:p1) { create(:label, title: 'P1', project: project, priority: 1) } let(:p2) { create(:label, title: 'P2', project: project, priority: 2) } let!(:issue1) { create(:labeled_issue, project: project, labels: [p1]) } @@ -74,7 +74,7 @@ describe Issue do describe '#to_reference' do let(:namespace) { build(:namespace, path: 'sample-namespace') } - let(:project) { build(:empty_project, name: 'sample-project', namespace: namespace) } + let(:project) { build(:project, name: 'sample-project', namespace: namespace) } let(:issue) { build(:issue, iid: 1, project: project) } let(:group) { create(:group, name: 'Group', path: 'sample-group') } @@ -99,7 +99,7 @@ describe Issue do end context 'when cross namespace project argument' do - let(:another_namespace_project) { create(:empty_project, name: 'another-project') } + let(:another_namespace_project) { create(:project, name: 'another-project') } it 'returns complete path to the issue' do expect(issue.to_reference(another_namespace_project)).to eq 'sample-namespace/sample-project#1' @@ -107,12 +107,12 @@ describe Issue do end it 'supports a cross-project reference' do - another_project = build(:empty_project, name: 'another-project', namespace: project.namespace) + another_project = build(:project, name: 'another-project', namespace: project.namespace) expect(issue.to_reference(another_project)).to eq "sample-project#1" end context 'when same namespace / cross-project argument' do - let(:another_project) { create(:empty_project, namespace: namespace) } + let(:another_project) { create(:project, namespace: namespace) } it 'returns path to the issue with the project name' do expect(issue.to_reference(another_project)).to eq 'sample-project#1' @@ -121,7 +121,7 @@ describe Issue do context 'when different namespace / cross-project argument' do let(:another_namespace) { create(:namespace, path: 'another-namespace') } - let(:another_project) { create(:empty_project, path: 'another-project', namespace: another_namespace) } + let(:another_project) { create(:project, path: 'another-project', namespace: another_namespace) } it 'returns full path to the issue' do expect(issue.to_reference(another_project)).to eq 'sample-namespace/sample-project#1' @@ -209,7 +209,7 @@ describe Issue do describe '#referenced_merge_requests' do it 'returns the referenced merge requests' do - project = create(:empty_project, :public) + project = create(:project, :public) mr1 = create(:merge_request, source_project: project, @@ -242,7 +242,7 @@ describe Issue do end context 'user is reporter in project issue belongs to' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:issue) { create(:issue, project: project) } before do @@ -258,7 +258,7 @@ describe Issue do context 'checking destination project also' do subject { issue.can_move?(user, to_project) } - let(:to_project) { create(:empty_project) } + let(:to_project) { create(:project) } context 'destination project allowed' do before do @@ -380,7 +380,7 @@ describe Issue do describe '#participants' do context 'using a public project' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:issue) { create(:issue, project: project) } let!(:note1) do @@ -402,7 +402,7 @@ describe Issue do context 'using a private project' do it 'does not include mentioned users that do not have access to the project' do - project = create(:empty_project) + project = create(:project) user = create(:user) issue = create(:issue, project: project) @@ -420,7 +420,7 @@ describe Issue do it 'updates when assignees change' do user1 = create(:user) user2 = create(:user) - project = create(:empty_project) + project = create(:project) issue = create(:issue, assignees: [user1], project: project) project.add_developer(user1) project.add_developer(user2) @@ -490,7 +490,7 @@ describe Issue do let(:user) { create(:user) } context 'using a public project' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } it 'returns true for a regular issue' do issue = build(:issue, project: project) @@ -506,7 +506,7 @@ describe Issue do end context 'using an internal project' do - let(:project) { create(:empty_project, :internal) } + let(:project) { create(:project, :internal) } context 'using an internal user' do it 'returns true for a regular issue' do @@ -542,7 +542,7 @@ describe Issue do end context 'using a private project' do - let(:project) { create(:empty_project, :private) } + let(:project) { create(:project, :private) } it 'returns false for a regular issue' do issue = build(:issue, project: project) @@ -578,7 +578,7 @@ describe Issue do context 'with a regular user that is a team member' do let(:user) { create(:user) } - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } context 'using a public project' do before do @@ -599,7 +599,7 @@ describe Issue do end context 'using an internal project' do - let(:project) { create(:empty_project, :internal) } + let(:project) { create(:project, :internal) } before do project.team << [user, Gitlab::Access::DEVELOPER] @@ -619,7 +619,7 @@ describe Issue do end context 'using a private project' do - let(:project) { create(:empty_project, :private) } + let(:project) { create(:project, :private) } before do project.team << [user, Gitlab::Access::DEVELOPER] @@ -640,7 +640,7 @@ describe Issue do end context 'with an admin user' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:admin) } it 'returns true for a regular issue' do @@ -659,7 +659,7 @@ describe Issue do describe '#publicly_visible?' do context 'using a public project' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } it 'returns true for a regular issue' do issue = build(:issue, project: project) @@ -675,7 +675,7 @@ describe Issue do end context 'using an internal project' do - let(:project) { create(:empty_project, :internal) } + let(:project) { create(:project, :internal) } it 'returns false for a regular issue' do issue = build(:issue, project: project) @@ -691,7 +691,7 @@ describe Issue do end context 'using a private project' do - let(:project) { create(:empty_project, :private) } + let(:project) { create(:project, :private) } it 'returns false for a regular issue' do issue = build(:issue, project: project) @@ -724,7 +724,7 @@ describe Issue do end describe '#check_for_spam' do - let(:project) { create :empty_project, visibility_level: visibility_level } + let(:project) { create :project, visibility_level: visibility_level } let(:issue) { create :issue, project: project } subject do diff --git a/spec/models/lfs_objects_project_spec.rb b/spec/models/lfs_objects_project_spec.rb index 8c74f1f9e86..d24d4cf7695 100644 --- a/spec/models/lfs_objects_project_spec.rb +++ b/spec/models/lfs_objects_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe LfsObjectsProject do subject { create(:lfs_objects_project, project: project) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } describe 'associations' do it { is_expected.to belong_to(:project) } diff --git a/spec/models/member_spec.rb b/spec/models/member_spec.rb index 8bfd70b8d46..87513e18b25 100644 --- a/spec/models/member_spec.rb +++ b/spec/models/member_spec.rb @@ -57,7 +57,7 @@ describe Member do describe 'Scopes & finders' do before do - project = create(:empty_project, :public, :access_requestable) + project = create(:project, :public, :access_requestable) group = create(:group) @owner_user = create(:user).tap { |u| group.add_owner(u) } @owner = group.members.find_by(user_id: @owner_user.id) @@ -516,7 +516,7 @@ describe Member do describe "destroying a record", truncate: true do it "refreshes user's authorized projects" do - project = create(:empty_project, :private) + project = create(:project, :private) user = create(:user) member = project.team << [user, :reporter] diff --git a/spec/models/members/project_member_spec.rb b/spec/models/members/project_member_spec.rb index 025fb2bf441..f1d1f37c78a 100644 --- a/spec/models/members/project_member_spec.rb +++ b/spec/models/members/project_member_spec.rb @@ -24,7 +24,7 @@ describe ProjectMember do describe '.add_user' do it 'adds the user as a member' do user = create(:user) - project = create(:empty_project) + project = create(:project) expect(project.users).not_to include(user) @@ -82,8 +82,8 @@ describe ProjectMember do describe '.import_team' do before do - @project_1 = create(:empty_project) - @project_2 = create(:empty_project) + @project_1 = create(:project) + @project_2 = create(:project) @user_1 = create :user @user_2 = create :user @@ -112,7 +112,7 @@ describe ProjectMember do describe '.add_users_to_projects' do it 'adds the given users to the given projects' do - projects = create_list(:empty_project, 2) + projects = create_list(:project, 2) users = create_list(:user, 2) described_class.add_users_to_projects( @@ -130,8 +130,8 @@ describe ProjectMember do describe '.truncate_teams' do before do - @project_1 = create(:empty_project) - @project_2 = create(:empty_project) + @project_1 = create(:project) + @project_2 = create(:project) @user_1 = create :user @user_2 = create :user diff --git a/spec/models/merge_request_spec.rb b/spec/models/merge_request_spec.rb index d9903b9b951..3402c260f27 100644 --- a/spec/models/merge_request_spec.rb +++ b/spec/models/merge_request_spec.rb @@ -237,7 +237,7 @@ describe MergeRequest do end describe '#to_reference' do - let(:project) { build(:empty_project, name: 'sample-project') } + let(:project) { build(:project, name: 'sample-project') } let(:merge_request) { build(:merge_request, target_project: project, iid: 1) } it 'returns a String reference to the object' do @@ -245,7 +245,7 @@ describe MergeRequest do end it 'supports a cross-project reference' do - another_project = build(:empty_project, name: 'another-project', namespace: project.namespace) + another_project = build(:project, name: 'another-project', namespace: project.namespace) expect(merge_request.to_reference(another_project)).to eq "sample-project!1" end @@ -392,8 +392,8 @@ describe MergeRequest do describe '#for_fork?' do it 'returns true if the merge request is for a fork' do - subject.source_project = build_stubbed(:empty_project, namespace: create(:group)) - subject.target_project = build_stubbed(:empty_project, namespace: create(:group)) + subject.source_project = build_stubbed(:project, namespace: create(:group)) + subject.target_project = build_stubbed(:project, namespace: create(:group)) expect(subject.for_fork?).to be_truthy end @@ -889,7 +889,7 @@ describe MergeRequest do end describe '#participants' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:mr) do create(:merge_request, source_project: project, target_project: project) @@ -932,7 +932,7 @@ describe MergeRequest do end describe '#check_if_can_be_merged' do - let(:project) { create(:empty_project, only_allow_merge_if_pipeline_succeeds: true) } + let(:project) { create(:project, only_allow_merge_if_pipeline_succeeds: true) } subject { create(:merge_request, source_project: project, merge_status: :unchecked) } @@ -970,7 +970,7 @@ describe MergeRequest do end describe '#mergeable?' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } subject { create(:merge_request, source_project: project) } @@ -1055,7 +1055,7 @@ describe MergeRequest do end describe '#mergeable_ci_state?' do - let(:project) { create(:empty_project, only_allow_merge_if_pipeline_succeeds: true) } + let(:project) { create(:project, only_allow_merge_if_pipeline_succeeds: true) } let(:pipeline) { create(:ci_empty_pipeline) } subject { build(:merge_request, target_project: project) } @@ -1098,7 +1098,7 @@ describe MergeRequest do end context 'when merges are not restricted to green builds' do - subject { build(:merge_request, target_project: build(:empty_project, only_allow_merge_if_pipeline_succeeds: false)) } + subject { build(:merge_request, target_project: build(:project, only_allow_merge_if_pipeline_succeeds: false)) } context 'and a failed pipeline is associated' do before do @@ -1332,8 +1332,8 @@ describe MergeRequest do end describe "#source_project_missing?" do - let(:project) { create(:empty_project) } - let(:fork_project) { create(:empty_project, forked_from_project: project) } + let(:project) { create(:project) } + let(:fork_project) { create(:project, forked_from_project: project) } let(:user) { create(:user) } let(:unlink_project) { Projects::UnlinkForkService.new(fork_project, user) } @@ -1370,8 +1370,8 @@ describe MergeRequest do end describe "#closed_without_fork?" do - let(:project) { create(:empty_project) } - let(:fork_project) { create(:empty_project, forked_from_project: project) } + let(:project) { create(:project) } + let(:fork_project) { create(:project, forked_from_project: project) } let(:user) { create(:user) } let(:unlink_project) { Projects::UnlinkForkService.new(fork_project, user) } @@ -1416,9 +1416,9 @@ describe MergeRequest do end context 'forked project' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } - let(:fork_project) { create(:empty_project, forked_from_project: project, namespace: user.namespace) } + let(:fork_project) { create(:project, forked_from_project: project, namespace: user.namespace) } let!(:merge_request) do create(:closed_merge_request, diff --git a/spec/models/milestone_spec.rb b/spec/models/milestone_spec.rb index aa376e242e8..b48aa9558d5 100644 --- a/spec/models/milestone_spec.rb +++ b/spec/models/milestone_spec.rb @@ -21,7 +21,7 @@ describe Milestone do it { is_expected.to have_many(:issues) } end - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:milestone) { create(:milestone, project: project) } let(:issue) { create(:issue, project: project) } let(:user) { create(:user) } @@ -42,7 +42,7 @@ describe Milestone do end it "accepts the same title in another project" do - project = create(:empty_project) + project = create(:project) new_milestone = described_class.new(project: project, title: milestone.title) expect(new_milestone).to be_valid @@ -197,9 +197,9 @@ describe Milestone do end describe '.upcoming_ids_by_projects' do - let(:project_1) { create(:empty_project) } - let(:project_2) { create(:empty_project) } - let(:project_3) { create(:empty_project) } + let(:project_1) { create(:project) } + let(:project_2) { create(:project) } + let(:project_3) { create(:project) } let(:projects) { [project_1, project_2, project_3] } let!(:past_milestone_project_1) { create(:milestone, project: project_1, due_date: Time.now - 1.day) } @@ -230,7 +230,7 @@ describe Milestone do end describe '#to_reference' do - let(:project) { build(:empty_project, name: 'sample-project') } + let(:project) { build(:project, name: 'sample-project') } let(:milestone) { build(:milestone, iid: 1, project: project) } it 'returns a String reference to the object' do @@ -238,13 +238,13 @@ describe Milestone do end it 'supports a cross-project reference' do - another_project = build(:empty_project, name: 'another-project', namespace: project.namespace) + another_project = build(:project, name: 'another-project', namespace: project.namespace) expect(milestone.to_reference(another_project)).to eq "sample-project%1" end end describe '#participants' do - let(:project) { build(:empty_project, name: 'sample-project') } + let(:project) { build(:project, name: 'sample-project') } let(:milestone) { build(:milestone, iid: 1, project: project) } it 'returns participants without duplicates' do diff --git a/spec/models/namespace_spec.rb b/spec/models/namespace_spec.rb index f12fe226e6b..1a00c50690c 100644 --- a/spec/models/namespace_spec.rb +++ b/spec/models/namespace_spec.rb @@ -111,7 +111,7 @@ describe Namespace do let(:namespace) { create :namespace } let(:project1) do - create(:empty_project, + create(:project, namespace: namespace, statistics: build(:project_statistics, storage_size: 606, @@ -121,7 +121,7 @@ describe Namespace do end let(:project2) do - create(:empty_project, + create(:project, namespace: namespace, statistics: build(:project_statistics, storage_size: 60, @@ -177,7 +177,7 @@ describe Namespace do stub_container_registry_config(enabled: true) stub_container_registry_tags(repository: :any, tags: ['tag']) - create(:empty_project, namespace: @namespace, container_repositories: [container_repository]) + create(:project, namespace: @namespace, container_repositories: [container_repository]) allow(@namespace).to receive(:path_was).and_return(@namespace.path) allow(@namespace).to receive(:path).and_return('new_path') diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb index cbe6d42ef53..b214074fdce 100644 --- a/spec/models/note_spec.rb +++ b/spec/models/note_spec.rb @@ -46,7 +46,7 @@ describe Note do context 'when noteable and note project differ' do subject do build(:note, noteable: build_stubbed(:issue), - project: build_stubbed(:empty_project)) + project: build_stubbed(:project)) end it { is_expected.to be_invalid } @@ -97,8 +97,8 @@ describe Note do describe 'authorization' do before do - @p1 = create(:empty_project) - @p2 = create(:empty_project) + @p1 = create(:project) + @p2 = create(:project) @u1 = create(:user) @u2 = create(:user) @u3 = create(:user) @@ -195,10 +195,10 @@ describe Note do describe "cross_reference_not_visible_for?" do let(:private_user) { create(:user) } - let(:private_project) { create(:empty_project, namespace: private_user.namespace) { |p| p.team << [private_user, :master] } } + let(:private_project) { create(:project, namespace: private_user.namespace) { |p| p.team << [private_user, :master] } } let(:private_issue) { create(:issue, project: private_project) } - let(:ext_proj) { create(:empty_project, :public) } + let(:ext_proj) { create(:project, :public) } let(:ext_issue) { create(:issue, project: ext_proj) } let(:note) do @@ -241,7 +241,7 @@ describe Note do describe '#participants' do it 'includes the note author' do - project = create(:empty_project, :public) + project = create(:project, :public) issue = create(:issue, project: project) note = create(:note_on_issue, noteable: issue, project: project) diff --git a/spec/models/project_authorization_spec.rb b/spec/models/project_authorization_spec.rb index ee6bdc39c8c..9e7e525b2c0 100644 --- a/spec/models/project_authorization_spec.rb +++ b/spec/models/project_authorization_spec.rb @@ -2,8 +2,8 @@ require 'spec_helper' describe ProjectAuthorization do let(:user) { create(:user) } - let(:project1) { create(:empty_project) } - let(:project2) { create(:empty_project) } + let(:project1) { create(:project) } + let(:project2) { create(:project) } describe '.insert_authorizations' do it 'inserts the authorizations' do diff --git a/spec/models/project_feature_spec.rb b/spec/models/project_feature_spec.rb index 580c83c12c0..de3e86b627f 100644 --- a/spec/models/project_feature_spec.rb +++ b/spec/models/project_feature_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe ProjectFeature do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } describe '.quoted_access_level_column' do @@ -47,7 +47,7 @@ describe ProjectFeature do it "returns true when user is a member of project group" do group = create(:group) - project = create(:empty_project, namespace: group) + project = create(:project, namespace: group) group.add_developer(user) features.each do |feature| diff --git a/spec/models/project_group_link_spec.rb b/spec/models/project_group_link_spec.rb index 0938a7b1b6d..b3513c80150 100644 --- a/spec/models/project_group_link_spec.rb +++ b/spec/models/project_group_link_spec.rb @@ -9,7 +9,7 @@ describe ProjectGroupLink do describe "Validation" do let(:parent_group) { create(:group) } let(:group) { create(:group, parent: parent_group) } - let(:project) { create(:empty_project, group: group) } + let(:project) { create(:project, group: group) } let!(:project_group_link) { create(:project_group_link, project: project) } it { is_expected.to validate_presence_of(:project_id) } @@ -32,7 +32,7 @@ describe ProjectGroupLink do describe "destroying a record", truncate: true do it "refreshes group users' authorized projects" do - project = create(:empty_project, :private) + project = create(:project, :private) group = create(:group) reporter = create(:user) group_users = group.users diff --git a/spec/models/project_label_spec.rb b/spec/models/project_label_spec.rb index c47f32d8d77..689d4e505e5 100644 --- a/spec/models/project_label_spec.rb +++ b/spec/models/project_label_spec.rb @@ -10,7 +10,7 @@ describe ProjectLabel do context 'validates if title must not exist at group level' do let(:group) { create(:group, name: 'gitlab-org') } - let(:project) { create(:empty_project, group: group) } + let(:project) { create(:project, group: group) } before do create(:group_label, group: group, title: 'Bug') @@ -33,7 +33,7 @@ describe ProjectLabel do end it 'does not returns error if project does not belong to group' do - another_project = create(:empty_project) + another_project = create(:project) label = described_class.new(project: another_project, title: 'Bug') label.valid? @@ -66,7 +66,7 @@ describe ProjectLabel do describe '#subject' do it 'aliases project to subject' do - subject = described_class.new(project: build(:empty_project)) + subject = described_class.new(project: build(:project)) expect(subject.subject).to be(subject.project) end @@ -100,7 +100,7 @@ describe ProjectLabel do end context 'cross project reference' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } context 'using name' do it 'returns cross reference with label name' do diff --git a/spec/models/project_services/asana_service_spec.rb b/spec/models/project_services/asana_service_spec.rb index 4684c970885..04440d890aa 100644 --- a/spec/models/project_services/asana_service_spec.rb +++ b/spec/models/project_services/asana_service_spec.rb @@ -18,7 +18,7 @@ describe AsanaService do describe 'Execute' do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } def create_data_for_commits(*messages) { diff --git a/spec/models/project_services/bamboo_service_spec.rb b/spec/models/project_services/bamboo_service_spec.rb index 82f02126de1..85baaccf035 100644 --- a/spec/models/project_services/bamboo_service_spec.rb +++ b/spec/models/project_services/bamboo_service_spec.rb @@ -7,7 +7,7 @@ describe BambooService, :use_clean_rails_memory_store_caching do subject(:service) do described_class.create( - project: create(:empty_project), + project: create(:project), properties: { bamboo_url: bamboo_url, username: 'mic', diff --git a/spec/models/project_services/buildkite_service_spec.rb b/spec/models/project_services/buildkite_service_spec.rb index 3f7eb33e08a..1615a93a4ca 100644 --- a/spec/models/project_services/buildkite_service_spec.rb +++ b/spec/models/project_services/buildkite_service_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe BuildkiteService, :use_clean_rails_memory_store_caching do include ReactiveCachingHelpers - let(:project) { create(:empty_project) } + let(:project) { create(:project) } subject(:service) do described_class.create( diff --git a/spec/models/project_services/chat_notification_service_spec.rb b/spec/models/project_services/chat_notification_service_spec.rb index ae80c4ae002..3aa1039d8bf 100644 --- a/spec/models/project_services/chat_notification_service_spec.rb +++ b/spec/models/project_services/chat_notification_service_spec.rb @@ -12,7 +12,7 @@ describe ChatNotificationService do describe '#can_test?' do context 'with empty repository' do it 'returns true' do - subject.project = create(:empty_project, :empty_repo) + subject.project = create(:project, :empty_repo) expect(subject.can_test?).to be true end diff --git a/spec/models/project_services/external_wiki_service_spec.rb b/spec/models/project_services/external_wiki_service_spec.rb index 22cd9d5e31e..25e6ce7e804 100644 --- a/spec/models/project_services/external_wiki_service_spec.rb +++ b/spec/models/project_services/external_wiki_service_spec.rb @@ -27,7 +27,7 @@ describe ExternalWikiService do end describe 'External wiki' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } context 'when it is active' do before do diff --git a/spec/models/project_services/gitlab_issue_tracker_service_spec.rb b/spec/models/project_services/gitlab_issue_tracker_service_spec.rb index 45cc78c8ff4..3237b660a16 100644 --- a/spec/models/project_services/gitlab_issue_tracker_service_spec.rb +++ b/spec/models/project_services/gitlab_issue_tracker_service_spec.rb @@ -8,21 +8,21 @@ describe GitlabIssueTrackerService do describe 'Validations' do context 'when service is active' do - subject { described_class.new(project: create(:empty_project), active: true) } + subject { described_class.new(project: create(:project), active: true) } it { is_expected.to validate_presence_of(:issues_url) } it_behaves_like 'issue tracker service URL attribute', :issues_url end context 'when service is inactive' do - subject { described_class.new(project: create(:empty_project), active: false) } + subject { described_class.new(project: create(:project), active: false) } it { is_expected.not_to validate_presence_of(:issues_url) } end end describe 'project and issue urls' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:service) { project.create_gitlab_issue_tracker_service(active: true) } context 'with absolute urls' do diff --git a/spec/models/project_services/issue_tracker_service_spec.rb b/spec/models/project_services/issue_tracker_service_spec.rb index 3ca123cb75d..e6a1752576b 100644 --- a/spec/models/project_services/issue_tracker_service_spec.rb +++ b/spec/models/project_services/issue_tracker_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe IssueTrackerService do describe 'Validations' do - let(:project) { create :empty_project } + let(:project) { create :project } describe 'only one issue tracker per project' do let(:service) { RedmineService.new(project: project, active: true) } diff --git a/spec/models/project_services/jira_service_spec.rb b/spec/models/project_services/jira_service_spec.rb index 69bb8f1c725..204a00778a7 100644 --- a/spec/models/project_services/jira_service_spec.rb +++ b/spec/models/project_services/jira_service_spec.rb @@ -29,7 +29,7 @@ describe JiraService do context 'validating urls' do let(:service) do described_class.new( - project: create(:empty_project), + project: create(:project), active: true, username: 'username', password: 'test', @@ -74,7 +74,7 @@ describe JiraService do describe '#close_issue' do let(:custom_base_url) { 'http://custom_url' } let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:merge_request) { create(:merge_request) } before do @@ -190,7 +190,7 @@ describe JiraService do describe '#test_settings' do let(:jira_service) do described_class.new( - project: create(:empty_project), + project: create(:project), url: 'http://jira.example.com', username: 'jira_username', password: 'jira_password' @@ -233,7 +233,7 @@ describe JiraService do end describe "Stored password invalidation" do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } context "when a password was previously set" do before do @@ -338,7 +338,7 @@ describe JiraService do end describe 'description and title' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } context 'when it is not set' do before do @@ -373,7 +373,7 @@ describe JiraService do end describe 'project and issue urls' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } context 'when gitlab.yml was initialized' do before do diff --git a/spec/models/project_services/mattermost_slash_commands_service_spec.rb b/spec/models/project_services/mattermost_slash_commands_service_spec.rb index 4c21c8b88bd..522cf15f3ba 100644 --- a/spec/models/project_services/mattermost_slash_commands_service_spec.rb +++ b/spec/models/project_services/mattermost_slash_commands_service_spec.rb @@ -4,7 +4,7 @@ describe MattermostSlashCommandsService do it_behaves_like "chat slash commands service" context 'Mattermost API' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:service) { project.build_mattermost_slash_commands_service } let(:user) { create(:user) } diff --git a/spec/models/project_services/slack_slash_commands_service_spec.rb b/spec/models/project_services/slack_slash_commands_service_spec.rb index aea674c4f6b..0d95f454819 100644 --- a/spec/models/project_services/slack_slash_commands_service_spec.rb +++ b/spec/models/project_services/slack_slash_commands_service_spec.rb @@ -5,7 +5,7 @@ describe SlackSlashCommandsService do describe '#trigger' do context 'when an auth url is generated' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:params) do { team_domain: 'http://domain.tld', diff --git a/spec/models/project_services/teamcity_service_spec.rb b/spec/models/project_services/teamcity_service_spec.rb index 47fd0c79e0b..43a0ed99296 100644 --- a/spec/models/project_services/teamcity_service_spec.rb +++ b/spec/models/project_services/teamcity_service_spec.rb @@ -7,7 +7,7 @@ describe TeamcityService, :use_clean_rails_memory_store_caching do subject(:service) do described_class.create( - project: create(:empty_project), + project: create(:project), properties: { teamcity_url: teamcity_url, username: 'mic', diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 3bc6fb09778..8f951605954 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -82,7 +82,7 @@ describe Project do end describe '#members & #requesters' do - let(:project) { create(:empty_project, :public, :access_requestable) } + let(:project) { create(:project, :public, :access_requestable) } let(:requester) { create(:user) } let(:developer) { create(:user) } before do @@ -131,7 +131,7 @@ describe Project do end describe 'validation' do - let!(:project) { create(:empty_project) } + let!(:project) { create(:project) } it { is_expected.to validate_presence_of(:name) } it { is_expected.to validate_uniqueness_of(:name).scoped_to(:namespace_id) } @@ -154,7 +154,7 @@ describe Project do it { is_expected.to validate_presence_of(:repository_storage) } it 'does not allow new projects beyond user limits' do - project2 = build(:empty_project) + project2 = build(:project) allow(project2).to receive(:creator).and_return(double(can_create_project?: false, projects_limit: 0).as_null_object) expect(project2).not_to be_valid expect(project2.errors[:limit_reached].first).to match(/Personal project creation is not allowed/) @@ -163,7 +163,7 @@ describe Project do describe 'wiki path conflict' do context "when the new path has been used by the wiki of other Project" do it 'has an error on the name attribute' do - new_project = build_stubbed(:empty_project, namespace_id: project.namespace_id, path: "#{project.path}.wiki") + new_project = build_stubbed(:project, namespace_id: project.namespace_id, path: "#{project.path}.wiki") expect(new_project).not_to be_valid expect(new_project.errors[:name].first).to eq('has already been taken') @@ -172,8 +172,8 @@ describe Project do context "when the new wiki path has been used by the path of other Project" do it 'has an error on the name attribute' do - project_with_wiki_suffix = create(:empty_project, path: 'foo.wiki') - new_project = build_stubbed(:empty_project, namespace_id: project_with_wiki_suffix.namespace_id, path: 'foo') + project_with_wiki_suffix = create(:project, path: 'foo.wiki') + new_project = build_stubbed(:project, namespace_id: project_with_wiki_suffix.namespace_id, path: 'foo') expect(new_project).not_to be_valid expect(new_project.errors[:name].first).to eq('has already been taken') @@ -182,7 +182,7 @@ describe Project do end context 'repository storages inclussion' do - let(:project2) { build(:empty_project, repository_storage: 'missing') } + let(:project2) { build(:project, repository_storage: 'missing') } before do storages = { 'custom' => { 'path' => 'tmp/tests/custom_repositories' } } @@ -196,44 +196,44 @@ describe Project do end it 'does not allow an invalid URI as import_url' do - project2 = build(:empty_project, import_url: 'invalid://') + project2 = build(:project, import_url: 'invalid://') expect(project2).not_to be_valid end it 'does allow a valid URI as import_url' do - project2 = build(:empty_project, import_url: 'ssh://test@gitlab.com/project.git') + project2 = build(:project, import_url: 'ssh://test@gitlab.com/project.git') expect(project2).to be_valid end it 'allows an empty URI' do - project2 = build(:empty_project, import_url: '') + project2 = build(:project, import_url: '') expect(project2).to be_valid end it 'does not produce import data on an empty URI' do - project2 = build(:empty_project, import_url: '') + project2 = build(:project, import_url: '') expect(project2.import_data).to be_nil end it 'does not produce import data on an invalid URI' do - project2 = build(:empty_project, import_url: 'test://') + project2 = build(:project, import_url: 'test://') expect(project2.import_data).to be_nil end it "does not allow blocked import_url localhost" do - project2 = build(:empty_project, import_url: 'http://localhost:9000/t.git') + project2 = build(:project, import_url: 'http://localhost:9000/t.git') expect(project2).to be_invalid expect(project2.errors[:import_url]).to include('imports are not allowed from that URL') end it "does not allow blocked import_url port" do - project2 = build(:empty_project, import_url: 'http://github.com:25/t.git') + project2 = build(:project, import_url: 'http://github.com:25/t.git') expect(project2).to be_invalid expect(project2.errors[:import_url]).to include('imports are not allowed from that URL') @@ -241,11 +241,11 @@ describe Project do describe 'project pending deletion' do let!(:project_pending_deletion) do - create(:empty_project, + create(:project, pending_delete: true) end let(:new_project) do - build(:empty_project, + build(:project, name: project_pending_deletion.name, namespace: project_pending_deletion.namespace) end @@ -261,27 +261,27 @@ describe Project do describe 'path validation' do it 'allows paths reserved on the root namespace' do - project = build(:empty_project, path: 'api') + project = build(:project, path: 'api') expect(project).to be_valid end it 'rejects paths reserved on another level' do - project = build(:empty_project, path: 'tree') + project = build(:project, path: 'tree') expect(project).not_to be_valid end it 'rejects nested paths' do parent = create(:group, :nested, path: 'environments') - project = build(:empty_project, path: 'folders', namespace: parent) + project = build(:project, path: 'folders', namespace: parent) expect(project).not_to be_valid end it 'allows a reserved group name' do parent = create(:group) - project = build(:empty_project, path: 'avatar', namespace: parent) + project = build(:project, path: 'avatar', namespace: parent) expect(project).to be_valid end @@ -290,12 +290,12 @@ describe Project do describe 'project token' do it 'sets an random token if none provided' do - project = FactoryGirl.create :empty_project, runners_token: '' + project = FactoryGirl.create :project, runners_token: '' expect(project.runners_token).not_to eq('') end it 'does not set an random token if one provided' do - project = FactoryGirl.create :empty_project, runners_token: 'my-token' + project = FactoryGirl.create :project, runners_token: 'my-token' expect(project.runners_token).to eq('my-token') end end @@ -323,7 +323,7 @@ describe Project do describe '#to_reference' do let(:owner) { create(:user, name: 'Gitlab') } let(:namespace) { create(:namespace, path: 'sample-namespace', owner: owner) } - let(:project) { create(:empty_project, path: 'sample-project', namespace: namespace) } + let(:project) { create(:project, path: 'sample-project', namespace: namespace) } let(:group) { create(:group, name: 'Group', path: 'sample-group', owner: owner) } context 'when nil argument' do @@ -347,7 +347,7 @@ describe Project do end context 'when cross namespace project argument' do - let(:another_namespace_project) { create(:empty_project, name: 'another-project') } + let(:another_namespace_project) { create(:project, name: 'another-project') } it 'returns complete path to the project' do expect(project.to_reference(another_namespace_project)).to eq 'sample-namespace/sample-project' @@ -355,7 +355,7 @@ describe Project do end context 'when same namespace / cross-project argument' do - let(:another_project) { create(:empty_project, namespace: namespace) } + let(:another_project) { create(:project, namespace: namespace) } it 'returns path to the project' do expect(project.to_reference(another_project)).to eq 'sample-project' @@ -364,7 +364,7 @@ describe Project do context 'when different namespace / cross-project argument' do let(:another_namespace) { create(:namespace, path: 'another-namespace', owner: owner) } - let(:another_project) { create(:empty_project, path: 'another-project', namespace: another_namespace) } + let(:another_project) { create(:project, path: 'another-project', namespace: another_namespace) } it 'returns full path to the project' do expect(project.to_reference(another_project)).to eq 'sample-namespace/sample-project' @@ -389,7 +389,7 @@ describe Project do describe '#to_human_reference' do let(:owner) { create(:user, name: 'Gitlab') } let(:namespace) { create(:namespace, name: 'Sample namespace', owner: owner) } - let(:project) { create(:empty_project, name: 'Sample project', namespace: namespace) } + let(:project) { create(:project, name: 'Sample project', namespace: namespace) } context 'when nil argument' do it 'returns nil' do @@ -404,7 +404,7 @@ describe Project do end context 'when cross namespace project argument' do - let(:another_namespace_project) { create(:empty_project, name: 'another-project') } + let(:another_namespace_project) { create(:project, name: 'another-project') } it 'returns complete name with namespace of the project' do expect(project.to_human_reference(another_namespace_project)).to eq 'Gitlab / Sample project' @@ -412,7 +412,7 @@ describe Project do end context 'when same namespace / cross-project argument' do - let(:another_project) { create(:empty_project, namespace: namespace) } + let(:another_project) { create(:project, namespace: namespace) } it 'returns name of the project' do expect(project.to_human_reference(another_project)).to eq 'Sample project' @@ -421,7 +421,7 @@ describe Project do end describe '#repository_storage_path' do - let(:project) { create(:empty_project, repository_storage: 'custom') } + let(:project) { create(:project, repository_storage: 'custom') } before do FileUtils.mkdir('tmp/tests/custom_repositories') @@ -444,7 +444,7 @@ describe Project do end describe "#web_url" do - let(:project) { create(:empty_project, path: "somewhere") } + let(:project) { create(:project, path: "somewhere") } it 'returns the full web URL for this repo' do expect(project.web_url).to eq("#{Gitlab.config.gitlab.url}/#{project.namespace.full_path}/somewhere") @@ -452,7 +452,7 @@ describe Project do end describe "#new_issue_address" do - let(:project) { create(:empty_project, path: "somewhere") } + let(:project) { create(:project, path: "somewhere") } let(:user) { create(:user) } context 'incoming email enabled' do @@ -481,7 +481,7 @@ describe Project do describe 'last_activity methods' do let(:timestamp) { 2.hours.ago } # last_activity_at gets set to created_at upon creation - let(:project) { create(:empty_project, created_at: timestamp, updated_at: timestamp) } + let(:project) { create(:project, created_at: timestamp, updated_at: timestamp) } describe 'last_activity' do it 'alias last_activity to last_event' do @@ -506,7 +506,7 @@ describe Project do end describe '#get_issue' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let!(:issue) { create(:issue, project: project) } let(:user) { create(:user) } @@ -581,7 +581,7 @@ describe Project do end describe '#issue_exists?' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } it 'is truthy when issue exists' do expect(project).to receive(:get_issue).and_return(double) @@ -598,7 +598,7 @@ describe Project do context 'with namespace' do before do @group = create :group, name: 'gitlab' - @project = create(:empty_project, name: 'gitlabhq', namespace: @group) + @project = create(:project, name: 'gitlabhq', namespace: @group) end it { expect(@project.to_param).to eq('gitlabhq') } @@ -606,7 +606,7 @@ describe Project do context 'with invalid path' do it 'returns previous path to keep project suitable for use in URLs when persisted' do - project = create(:empty_project, path: 'gitlab') + project = create(:project, path: 'gitlab') project.path = 'foo&bar' expect(project).not_to be_valid @@ -614,7 +614,7 @@ describe Project do end it 'returns current path when new record' do - project = build(:empty_project, path: 'gitlab') + project = build(:project, path: 'gitlab') project.path = 'foo&bar' expect(project).not_to be_valid @@ -633,7 +633,7 @@ describe Project do describe '#default_issues_tracker?' do it "is true if used internal tracker" do - project = build(:empty_project) + project = build(:project) expect(project.default_issues_tracker?).to be_truthy end @@ -647,7 +647,7 @@ describe Project do end describe '#external_issue_tracker' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:ext_project) { create(:redmine_project) } context 'on existing projects with no value for has_external_issue_tracker' do @@ -682,7 +682,7 @@ describe Project do end describe '#cache_has_external_issue_tracker' do - let(:project) { create(:empty_project, has_external_issue_tracker: nil) } + let(:project) { create(:project, has_external_issue_tracker: nil) } it 'stores true if there is any external_issue_tracker' do services = double(:service, external_issue_trackers: [RedmineService.new]) @@ -704,9 +704,9 @@ describe Project do end describe '#has_wiki?' do - let(:no_wiki_project) { create(:empty_project, :wiki_disabled, has_external_wiki: false) } - let(:wiki_enabled_project) { create(:empty_project) } - let(:external_wiki_project) { create(:empty_project, has_external_wiki: true) } + let(:no_wiki_project) { create(:project, :wiki_disabled, has_external_wiki: false) } + let(:wiki_enabled_project) { create(:project) } + let(:external_wiki_project) { create(:project, has_external_wiki: true) } it 'returns true if project is wiki enabled or has external wiki' do expect(wiki_enabled_project).to have_wiki @@ -716,7 +716,7 @@ describe Project do end describe '#external_wiki' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } context 'with an active external wiki' do before do @@ -770,7 +770,7 @@ describe Project do it 'counts stars from multiple users' do user1 = create :user user2 = create :user - project = create(:empty_project, :public) + project = create(:project, :public) expect(project.star_count).to eq(0) @@ -792,8 +792,8 @@ describe Project do it 'counts stars on the right project' do user = create :user - project1 = create(:empty_project, :public) - project2 = create(:empty_project, :public) + project1 = create(:project, :public) + project2 = create(:project, :public) expect(project1.star_count).to eq(0) expect(project2.star_count).to eq(0) @@ -825,7 +825,7 @@ describe Project do end describe '#avatar_type' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } it 'is true if avatar is image' do project.update_attribute(:avatar, 'uploads/avatar.png') @@ -841,10 +841,10 @@ describe Project do describe '#avatar_url' do subject { project.avatar_url } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } context 'when avatar file is uploaded' do - let(:project) { create(:empty_project, :with_avatar) } + let(:project) { create(:project, :with_avatar) } let(:avatar_path) { "/uploads/-/system/project/avatar/#{project.id}/dk.png" } let(:gitlab_host) { "http://#{Gitlab.config.gitlab.host}" } @@ -869,7 +869,7 @@ describe Project do end context 'when git repo is empty' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } it { is_expected.to eq nil } end @@ -910,7 +910,7 @@ describe Project do end describe '#builds_enabled' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } subject { project.builds_enabled } @@ -921,7 +921,7 @@ describe Project do subject { described_class.with_shared_runners } context 'when shared runners are enabled for project' do - let!(:project) { create(:empty_project, shared_runners_enabled: true) } + let!(:project) { create(:project, shared_runners_enabled: true) } it "returns a project" do is_expected.to eq([project]) @@ -929,7 +929,7 @@ describe Project do end context 'when shared runners are disabled for project' do - let!(:project) { create(:empty_project, shared_runners_enabled: false) } + let!(:project) { create(:project, shared_runners_enabled: false) } it "returns an empty array" do is_expected.to be_empty @@ -939,8 +939,8 @@ describe Project do describe '.cached_count', :use_clean_rails_memory_store_caching do let(:group) { create(:group, :public) } - let!(:project1) { create(:empty_project, :public, group: group) } - let!(:project2) { create(:empty_project, :public, group: group) } + let!(:project1) { create(:project, :public, group: group) } + let!(:project2) { create(:project, :public, group: group) } it 'returns total project count' do expect(described_class).to receive(:count).once.and_call_original @@ -953,8 +953,8 @@ describe Project do describe '.trending' do let(:group) { create(:group, :public) } - let(:project1) { create(:empty_project, :public, group: group) } - let(:project2) { create(:empty_project, :public, group: group) } + let(:project1) { create(:project, :public, group: group) } + let(:project2) { create(:project, :public, group: group) } before do 2.times do @@ -985,9 +985,9 @@ describe Project do it 'returns only projects starred by the given user' do user1 = create(:user) user2 = create(:user) - project1 = create(:empty_project) - project2 = create(:empty_project) - create(:empty_project) + project1 = create(:project) + project2 = create(:project) + create(:project) user1.toggle_star(project1) user2.toggle_star(project2) @@ -996,7 +996,7 @@ describe Project do end describe '.visible_to_user' do - let!(:project) { create(:empty_project, :private) } + let!(:project) { create(:project, :private) } let!(:user) { create(:user) } subject { described_class.visible_to_user(user) } @@ -1015,7 +1015,7 @@ describe Project do end context 'repository storage by default' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } before do storages = { @@ -1033,7 +1033,7 @@ describe Project do end context 'shared runners by default' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } subject { project.shared_runners_enabled } @@ -1055,7 +1055,7 @@ describe Project do end describe '#any_runners' do - let(:project) { create(:empty_project, shared_runners_enabled: shared_runners_enabled) } + let(:project) { create(:project, shared_runners_enabled: shared_runners_enabled) } let(:specific_runner) { create(:ci_runner) } let(:shared_runner) { create(:ci_runner, :shared) } @@ -1103,7 +1103,7 @@ describe Project do subject { project.shared_runners } context 'when shared runners are enabled for project' do - let!(:project) { create(:empty_project, shared_runners_enabled: true) } + let!(:project) { create(:project, shared_runners_enabled: true) } it "returns a list of shared runners" do is_expected.to eq([runner]) @@ -1111,7 +1111,7 @@ describe Project do end context 'when shared runners are disabled for project' do - let!(:project) { create(:empty_project, shared_runners_enabled: false) } + let!(:project) { create(:project, shared_runners_enabled: false) } it "returns a empty list" do is_expected.to be_empty @@ -1120,7 +1120,7 @@ describe Project do end describe '#visibility_level_allowed?' do - let(:project) { create(:empty_project, :internal) } + let(:project) { create(:project, :internal) } context 'when checking on non-forked project' do it { expect(project.visibility_level_allowed?(Gitlab::VisibilityLevel::PRIVATE)).to be_truthy } @@ -1129,8 +1129,8 @@ describe Project do end context 'when checking on forked project' do - let(:project) { create(:empty_project, :internal) } - let(:forked_project) { create(:empty_project, forked_from_project: project) } + let(:project) { create(:project, :internal) } + let(:forked_project) { create(:project, forked_from_project: project) } it { expect(forked_project.visibility_level_allowed?(Gitlab::VisibilityLevel::PRIVATE)).to be_truthy } it { expect(forked_project.visibility_level_allowed?(Gitlab::VisibilityLevel::INTERNAL)).to be_truthy } @@ -1139,7 +1139,7 @@ describe Project do end describe '#pages_deployed?' do - let(:project) { create :empty_project } + let(:project) { create :project } subject { project.pages_deployed? } @@ -1158,7 +1158,7 @@ describe Project do describe '#pages_url' do let(:group) { create :group, name: group_name } - let(:project) { create :empty_project, namespace: group, name: project_name } + let(:project) { create :project, namespace: group, name: project_name } let(:domain) { 'Example.com' } subject { project.pages_url } @@ -1184,7 +1184,7 @@ describe Project do end describe '.search' do - let(:project) { create(:empty_project, description: 'kitten mittens') } + let(:project) { create(:project, description: 'kitten mittens') } it 'returns projects with a matching name' do expect(described_class.search(project.name)).to eq([project]) @@ -1241,7 +1241,7 @@ describe Project do end describe 'with pending_delete project' do - let(:pending_delete_project) { create(:empty_project, pending_delete: true) } + let(:pending_delete_project) { create(:project, pending_delete: true) } it 'shows pending deletion project' do search_result = described_class.search(pending_delete_project.name) @@ -1327,7 +1327,7 @@ describe Project do end describe '.search_by_title' do - let(:project) { create(:empty_project, name: 'kittens') } + let(:project) { create(:project, name: 'kittens') } it 'returns projects with a matching name' do expect(described_class.search_by_title(project.name)).to eq([project]) @@ -1346,8 +1346,8 @@ describe Project do let(:private_group) { create(:group, visibility_level: 0) } let(:internal_group) { create(:group, visibility_level: 10) } - let(:private_project) { create :empty_project, :private, group: private_group } - let(:internal_project) { create :empty_project, :internal, group: internal_group } + let(:private_project) { create :project, :private, group: private_group } + let(:internal_project) { create :project, :internal, group: internal_group } context 'when group is private project can not be internal' do it { expect(private_project.visibility_level_allowed?(Gitlab::VisibilityLevel::INTERNAL)).to be_falsey } @@ -1444,7 +1444,7 @@ describe Project do end describe '#user_can_push_to_empty_repo?' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } it 'returns false when default_branch_protection is in full protection and user is developer' do @@ -1483,7 +1483,7 @@ describe Project do end describe '#container_registry_url' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } subject { project.container_registry_url } @@ -1510,7 +1510,7 @@ describe Project do end describe '#has_container_registry_tags?' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } context 'when container registry is enabled' do before do @@ -1574,7 +1574,7 @@ describe Project do end describe '#ci_config_path=' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } it 'sets nil' do project.update!(ci_config_path: nil) @@ -1596,7 +1596,7 @@ describe Project do end describe 'Project import job' do - let(:project) { create(:empty_project, import_url: generate(:url)) } + let(:project) { create(:project, import_url: generate(:url)) } before do allow_any_instance_of(Gitlab::Shell).to receive(:import_repository) @@ -1633,7 +1633,7 @@ describe Project do end it 'does not perform housekeeping when project repository does not exist' do - project = create(:empty_project, :import_started, import_type: :github) + project = create(:project, :import_started, import_type: :github) project.import_finish @@ -1641,7 +1641,7 @@ describe Project do end it 'does not perform housekeeping when project does not have a valid import type' do - project = create(:empty_project, :import_started, import_type: nil) + project = create(:project, :import_started, import_type: nil) project.import_finish @@ -1746,7 +1746,7 @@ describe Project do context 'not forked' do it 'schedules a RepositoryImportWorker job' do - project = create(:empty_project, import_url: generate(:url)) + project = create(:project, import_url: generate(:url)) expect(RepositoryImportWorker).to receive(:perform_async).with(project.id) @@ -1756,19 +1756,19 @@ describe Project do end describe '#gitlab_project_import?' do - subject(:project) { build(:empty_project, import_type: 'gitlab_project') } + subject(:project) { build(:project, import_type: 'gitlab_project') } it { expect(project.gitlab_project_import?).to be true } end describe '#gitea_import?' do - subject(:project) { build(:empty_project, import_type: 'gitea') } + subject(:project) { build(:project, import_type: 'gitea') } it { expect(project.gitea_import?).to be true } end describe '#lfs_enabled?' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } shared_examples 'project overrides group' do it 'returns true when enabled in project' do @@ -1858,7 +1858,7 @@ describe Project do end describe '#pushes_since_gc' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } after do project.reset_pushes_since_gc @@ -1880,7 +1880,7 @@ describe Project do end describe '#increment_pushes_since_gc' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } after do project.reset_pushes_since_gc @@ -1894,7 +1894,7 @@ describe Project do end describe '#reset_pushes_since_gc' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } after do project.reset_pushes_since_gc @@ -1911,7 +1911,7 @@ describe Project do describe '#deployment_variables' do context 'when project has no deployment service' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } it 'returns an empty array' do expect(project.deployment_variables).to eq [] @@ -1930,7 +1930,7 @@ describe Project do end describe '#secret_variables_for' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let!(:secret_variable) do create(:ci_variable, value: 'secret', project: project) @@ -1977,7 +1977,7 @@ describe Project do end describe '#protected_for?' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } subject { project.protected_for?('ref') } @@ -2014,7 +2014,7 @@ describe Project do end describe '#update_project_statistics' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } it "is called after creation" do expect(project.statistics).to be_a ProjectStatistics @@ -2034,9 +2034,9 @@ describe Project do end describe 'inside_path' do - let!(:project1) { create(:empty_project, namespace: create(:namespace, path: 'name_pace')) } - let!(:project2) { create(:empty_project) } - let!(:project3) { create(:empty_project, namespace: create(:namespace, path: 'namespace')) } + let!(:project1) { create(:project, namespace: create(:namespace, path: 'name_pace')) } + let!(:project2) { create(:project) } + let!(:project3) { create(:project, namespace: create(:namespace, path: 'namespace')) } let!(:path) { project1.namespace.full_path } it 'returns correct project' do @@ -2121,13 +2121,13 @@ describe Project do end describe '#parent' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } it { expect(project.parent).to eq(project.namespace) } end describe '#parent_changed?' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } before do project.namespace_id = 7 @@ -2153,7 +2153,7 @@ describe Project do end context 'top-level group' do - let(:project) { create :empty_project, namespace: group, name: project_name } + let(:project) { create :project, namespace: group, name: project_name } context 'group page' do let(:project_name) { 'group.example.com' } @@ -2169,7 +2169,7 @@ describe Project do end context 'nested group' do - let(:project) { create :empty_project, namespace: nested_group, name: project_name } + let(:project) { create :project, namespace: nested_group, name: project_name } let(:expected_url) { "http://group.example.com/#{nested_group.path}/#{project.path}" } context 'group page' do @@ -2187,7 +2187,7 @@ describe Project do end describe '#http_url_to_repo' do - let(:project) { create :empty_project } + let(:project) { create :project } it 'returns the url to the repo without a username' do expect(project.http_url_to_repo).to eq("#{project.web_url}.git") @@ -2207,7 +2207,7 @@ describe Project do end describe '#append_or_update_attribute' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } it 'shows full error updating an invalid MR' do error_message = 'Failed to replace merge_requests because one or more of the new records could not be saved.'\ @@ -2227,7 +2227,7 @@ describe Project do describe '#last_repository_updated_at' do it 'sets to created_at upon creation' do - project = create(:empty_project, created_at: 2.hours.ago) + project = create(:project, created_at: 2.hours.ago) expect(project.last_repository_updated_at.to_i).to eq(project.created_at.to_i) end @@ -2237,10 +2237,10 @@ describe Project do let!(:user) { create(:user) } let!(:private_project) do - create(:empty_project, :private, creator: user, namespace: user.namespace) + create(:project, :private, creator: user, namespace: user.namespace) end - let!(:public_project) { create(:empty_project, :public) } + let!(:public_project) { create(:project, :public) } context 'with a user' do let(:projects) do @@ -2266,7 +2266,7 @@ describe Project do end describe '#remove_private_deploy_keys' do - let!(:project) { create(:empty_project) } + let!(:project) { create(:project) } context 'for a private deploy key' do let!(:key) { create(:deploy_key, public: false) } @@ -2282,7 +2282,7 @@ describe Project do context 'when the key is linked to another project' do before do - another_project = create(:empty_project) + another_project = create(:project) create(:deploy_keys_project, deploy_key: key, project: another_project) end diff --git a/spec/models/project_statistics_spec.rb b/spec/models/project_statistics_spec.rb index be1b37730b1..59e20e84c2f 100644 --- a/spec/models/project_statistics_spec.rb +++ b/spec/models/project_statistics_spec.rb @@ -1,7 +1,7 @@ require 'rails_helper' describe ProjectStatistics do - let(:project) { create :empty_project } + let(:project) { create :project } let(:statistics) { project.statistics } describe 'constants' do diff --git a/spec/models/project_team_spec.rb b/spec/models/project_team_spec.rb index 9ccd366a48e..314824b32da 100644 --- a/spec/models/project_team_spec.rb +++ b/spec/models/project_team_spec.rb @@ -7,7 +7,7 @@ describe ProjectTeam do let(:nonmember) { create(:user) } context 'personal project' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } before do project.add_master(master) @@ -37,7 +37,7 @@ describe ProjectTeam do context 'group project' do let(:group) { create(:group) } - let!(:project) { create(:empty_project, group: group) } + let!(:project) { create(:project, group: group) } before do group.add_master(master) @@ -75,7 +75,7 @@ describe ProjectTeam do describe '#fetch_members' do context 'personal project' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } it 'returns project members' do user = create(:user) @@ -119,7 +119,7 @@ describe ProjectTeam do context 'group project' do let(:group) { create(:group) } - let!(:project) { create(:empty_project, group: group) } + let!(:project) { create(:project, group: group) } it 'returns project members' do group_member = create(:group_member, group: group) @@ -139,7 +139,7 @@ describe ProjectTeam do describe '#find_member' do context 'personal project' do let(:project) do - create(:empty_project, :public, :access_requestable) + create(:project, :public, :access_requestable) end let(:requester) { create(:user) } @@ -160,7 +160,7 @@ describe ProjectTeam do context 'group project' do let(:group) { create(:group, :access_requestable) } - let(:project) { create(:empty_project, group: group) } + let(:project) { create(:project, group: group) } let(:requester) { create(:user) } before do @@ -182,7 +182,7 @@ describe ProjectTeam do it 'returns Master role' do user = create(:user) group = create(:group) - project = create(:empty_project, namespace: group) + project = create(:project, namespace: group) group.add_master(user) @@ -192,7 +192,7 @@ describe ProjectTeam do it 'returns Owner role' do user = create(:user) group = create(:group) - project = create(:empty_project, namespace: group) + project = create(:project, namespace: group) group.add_owner(user) @@ -205,7 +205,7 @@ describe ProjectTeam do context 'personal project' do let(:project) do - create(:empty_project, :public, :access_requestable) + create(:project, :public, :access_requestable) end context 'when project is not shared with group' do @@ -253,7 +253,7 @@ describe ProjectTeam do context 'group project' do let(:group) { create(:group, :access_requestable) } let!(:project) do - create(:empty_project, group: group) + create(:project, group: group) end before do @@ -277,15 +277,15 @@ describe ProjectTeam do let(:master) { create(:user) } let(:personal_project) do - create(:empty_project, namespace: developer.namespace) + create(:project, namespace: developer.namespace) end let(:group_project) do - create(:empty_project, namespace: group) + create(:project, namespace: group) end - let(:members_project) { create(:empty_project) } - let(:shared_project) { create(:empty_project) } + let(:members_project) { create(:project) } + let(:shared_project) { create(:project) } before do group.add_master(master) @@ -330,7 +330,7 @@ describe ProjectTeam do end shared_examples 'max member access for users' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:group) { create(:group) } let(:second_group) { create(:group) } diff --git a/spec/models/project_wiki_spec.rb b/spec/models/project_wiki_spec.rb index 484fcfc88a3..6e33431bbe9 100644 --- a/spec/models/project_wiki_spec.rb +++ b/spec/models/project_wiki_spec.rb @@ -1,7 +1,7 @@ require "spec_helper" describe ProjectWiki do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:repository) { project.repository } let(:user) { project.owner } let(:gitlab_shell) { Gitlab::Shell.new } @@ -42,7 +42,7 @@ describe ProjectWiki do end describe "#http_url_to_repo" do - let(:project) { create :empty_project } + let(:project) { create :project } it 'returns the full http url to the repo' do expected_url = "#{Gitlab.config.gitlab.url}/#{subject.full_path}.git" diff --git a/spec/models/protected_branch_spec.rb b/spec/models/protected_branch_spec.rb index a54af3bfe59..4c677200ae2 100644 --- a/spec/models/protected_branch_spec.rb +++ b/spec/models/protected_branch_spec.rb @@ -163,7 +163,7 @@ describe ProtectedBranch do end context "new project" do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } it 'returns false when default_protected_branch is unprotected' do stub_application_setting(default_branch_protection: Gitlab::Access::PROTECTION_NONE) diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb index 3107037925b..764f548be45 100644 --- a/spec/models/repository_spec.rb +++ b/spec/models/repository_spec.rb @@ -515,7 +515,7 @@ describe Repository do end it 'properly handles query when repo is empty' do - repository = create(:empty_project).repository + repository = create(:project).repository results = repository.search_files_by_content('test', 'master') expect(results).to match_array([]) @@ -543,7 +543,7 @@ describe Repository do end it 'properly handles query when repo is empty' do - repository = create(:empty_project).repository + repository = create(:project).repository results = repository.search_files_by_name('test', 'master') @@ -942,7 +942,7 @@ describe Repository do end it 'expires creation and branch cache' do - empty_repository = create(:empty_project, :empty_repo).repository + empty_repository = create(:project, :empty_repo).repository expect(empty_repository).to receive(:expire_exists_cache) expect(empty_repository).to receive(:expire_root_ref_cache) @@ -1804,7 +1804,7 @@ describe Repository do end describe '#commit_count_for_ref' do - let(:project) { create :empty_project } + let(:project) { create :project } context 'with a non-existing repository' do it 'returns 0' do diff --git a/spec/models/service_spec.rb b/spec/models/service_spec.rb index dba9fc4ac9b..0f2f906c667 100644 --- a/spec/models/service_spec.rb +++ b/spec/models/service_spec.rb @@ -23,7 +23,7 @@ describe Service do end context 'when repository is empty' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } it 'returns true' do expect(service.can_test?).to be true @@ -46,7 +46,7 @@ describe Service do end context 'when repository is empty' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } it 'test runs execute' do expect(service).to receive(:execute).with(data) @@ -69,7 +69,7 @@ describe Service do api_key: '123456789' }) end - let(:project) { create(:empty_project) } + let(:project) { create(:project) } describe 'is prefilled for projects pushover service' do it "has all fields prefilled" do @@ -88,7 +88,7 @@ describe Service do describe "{property}_changed?" do let(:service) do BambooService.create( - project: create(:empty_project), + project: create(:project), properties: { bamboo_url: 'http://gitlab.com', username: 'mic', @@ -128,7 +128,7 @@ describe Service do describe "{property}_touched?" do let(:service) do BambooService.create( - project: create(:empty_project), + project: create(:project), properties: { bamboo_url: 'http://gitlab.com', username: 'mic', @@ -168,7 +168,7 @@ describe Service do describe "{property}_was" do let(:service) do BambooService.create( - project: create(:empty_project), + project: create(:project), properties: { bamboo_url: 'http://gitlab.com', username: 'mic', @@ -208,7 +208,7 @@ describe Service do describe 'initialize service with no properties' do let(:service) do GitlabIssueTrackerService.create( - project: create(:empty_project), + project: create(:project), title: 'random title' ) end @@ -223,7 +223,7 @@ describe Service do end describe "callbacks" do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let!(:service) do RedmineService.new( project: project, diff --git a/spec/models/snippet_spec.rb b/spec/models/snippet_spec.rb index 904bf2c6144..de3ca300ae3 100644 --- a/spec/models/snippet_spec.rb +++ b/spec/models/snippet_spec.rb @@ -33,7 +33,7 @@ describe Snippet do describe '#to_reference' do context 'when snippet belongs to a project' do - let(:project) { build(:empty_project, name: 'sample-project') } + let(:project) { build(:project, name: 'sample-project') } let(:snippet) { build(:snippet, id: 1, project: project) } it 'returns a String reference to the object' do @@ -41,7 +41,7 @@ describe Snippet do end it 'supports a cross-project reference' do - another_project = build(:empty_project, name: 'another-project', namespace: project.namespace) + another_project = build(:project, name: 'another-project', namespace: project.namespace) expect(snippet.to_reference(another_project)).to eq "sample-project$1" end end @@ -54,14 +54,14 @@ describe Snippet do end it 'still returns shortest reference when project arg present' do - another_project = build(:empty_project, name: 'another-project') + another_project = build(:project, name: 'another-project') expect(snippet.to_reference(another_project)).to eq "$1" end end end describe '#file_name' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } context 'file_name is nil' do let(:snippet) { create(:snippet, project: project, file_name: nil) } @@ -132,7 +132,7 @@ describe Snippet do end describe '#participants' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:snippet) { create(:snippet, content: 'foo', project: project) } let!(:note1) do diff --git a/spec/models/trending_project_spec.rb b/spec/models/trending_project_spec.rb index cc28c6d4004..3b5e7ca0d39 100644 --- a/spec/models/trending_project_spec.rb +++ b/spec/models/trending_project_spec.rb @@ -2,11 +2,11 @@ require 'spec_helper' describe TrendingProject do let(:user) { create(:user) } - let(:public_project1) { create(:empty_project, :public) } - let(:public_project2) { create(:empty_project, :public) } - let(:public_project3) { create(:empty_project, :public) } - let(:private_project) { create(:empty_project, :private) } - let(:internal_project) { create(:empty_project, :internal) } + let(:public_project1) { create(:project, :public) } + let(:public_project2) { create(:project, :public) } + let(:public_project3) { create(:project, :public) } + let(:private_project) { create(:project, :private) } + let(:internal_project) { create(:project, :internal) } before do 3.times do diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index ec98a3f3498..a6bd6052006 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -80,7 +80,7 @@ describe User do describe '#project_members' do it 'does not include project memberships for which user is a requester' do user = create(:user) - project = create(:empty_project, :public, :access_requestable) + project = create(:project, :public, :access_requestable) project.request_access(user) expect(user.project_members).to be_empty @@ -560,11 +560,11 @@ describe User do before do @user = create(:user) - @project = create(:empty_project, namespace: @user.namespace) - @project_2 = create(:empty_project, group: create(:group)) do |project| + @project = create(:project, namespace: @user.namespace) + @project_2 = create(:project, group: create(:group)) do |project| project.add_master(@user) end - @project_3 = create(:empty_project, group: create(:group)) do |project| + @project_3 = create(:project, group: create(:group)) do |project| project.add_developer(@user) end end @@ -609,7 +609,7 @@ describe User do describe 'namespaced' do before do @user = create :user - @project = create(:empty_project, namespace: @user.namespace) + @project = create(:project, namespace: @user.namespace) end it { expect(@user.several_namespaces?).to be_falsey } @@ -666,7 +666,7 @@ describe User do end describe '.without_projects' do - let!(:project) { create(:empty_project, :public, :access_requestable) } + let!(:project) { create(:project, :public, :access_requestable) } let!(:user) { create(:user) } let!(:user_without_project) { create(:user) } let!(:user_without_project2) { create(:user) } @@ -1196,8 +1196,8 @@ describe User do describe '#starred?' do it 'determines if user starred a project' do user = create :user - project1 = create(:empty_project, :public) - project2 = create(:empty_project, :public) + project1 = create(:project, :public) + project2 = create(:project, :public) expect(user.starred?(project1)).to be_falsey expect(user.starred?(project2)).to be_falsey @@ -1223,7 +1223,7 @@ describe User do describe '#toggle_star' do it 'toggles stars' do user = create :user - project = create(:empty_project, :public) + project = create(:project, :public) expect(user.starred?(project)).to be_falsey user.toggle_star(project) @@ -1276,9 +1276,9 @@ describe User do describe "#contributed_projects" do subject { create(:user) } - let!(:project1) { create(:empty_project) } - let!(:project2) { create(:empty_project, forked_from_project: project3) } - let!(:project3) { create(:empty_project) } + let!(:project1) { create(:project) } + let!(:project2) { create(:project, forked_from_project: project3) } + let!(:project3) { create(:project) } let!(:merge_request) { create(:merge_request, source_project: project2, target_project: project3, author: subject) } let!(:push_event) { create(:event, :pushed, project: project1, target: project1, author: subject) } let!(:merge_event) { create(:event, :created, project: project3, target: merge_request, author: subject) } @@ -1376,7 +1376,7 @@ describe User do context 'with a minimum access level' do it 'includes projects for which the user is an owner' do user = create(:user) - project = create(:empty_project, :private, namespace: user.namespace) + project = create(:project, :private, namespace: user.namespace) expect(user.authorized_projects(Gitlab::Access::REPORTER)) .to contain_exactly(project) @@ -1384,7 +1384,7 @@ describe User do it 'includes projects for which the user is a master' do user = create(:user) - project = create(:empty_project, :private) + project = create(:project, :private) project.team << [user, Gitlab::Access::MASTER] @@ -1395,7 +1395,7 @@ describe User do it "includes user's personal projects" do user = create(:user) - project = create(:empty_project, :private, namespace: user.namespace) + project = create(:project, :private, namespace: user.namespace) expect(user.authorized_projects).to include(project) end @@ -1403,7 +1403,7 @@ describe User do it "includes personal projects user has been given access to" do user1 = create(:user) user2 = create(:user) - project = create(:empty_project, :private, namespace: user1.namespace) + project = create(:project, :private, namespace: user1.namespace) project.team << [user2, Gitlab::Access::DEVELOPER] @@ -1412,7 +1412,7 @@ describe User do it "includes projects of groups user has been added to" do group = create(:group) - project = create(:empty_project, group: group) + project = create(:project, group: group) user = create(:user) group.add_developer(user) @@ -1422,7 +1422,7 @@ describe User do it "does not include projects of groups user has been removed from" do group = create(:group) - project = create(:empty_project, group: group) + project = create(:project, group: group) user = create(:user) member = group.add_developer(user) @@ -1434,7 +1434,7 @@ describe User do it "includes projects shared with user's group" do user = create(:user) - project = create(:empty_project, :private) + project = create(:project, :private) group = create(:group) group.add_reporter(user) @@ -1446,7 +1446,7 @@ describe User do it "does not include destroyed projects user had access to" do user1 = create(:user) user2 = create(:user) - project = create(:empty_project, :private, namespace: user1.namespace) + project = create(:project, :private, namespace: user1.namespace) project.team << [user2, Gitlab::Access::DEVELOPER] expect(user2.authorized_projects).to include(project) @@ -1457,7 +1457,7 @@ describe User do it "does not include projects of destroyed groups user had access to" do group = create(:group) - project = create(:empty_project, namespace: group) + project = create(:project, namespace: group) user = create(:user) group.add_developer(user) @@ -1472,9 +1472,9 @@ describe User do let(:user) { create(:user) } it 'includes projects for which the user access level is above or equal to reporter' do - reporter_project = create(:empty_project) { |p| p.add_reporter(user) } - developer_project = create(:empty_project) { |p| p.add_developer(user) } - master_project = create(:empty_project) { |p| p.add_master(user) } + reporter_project = create(:project) { |p| p.add_reporter(user) } + developer_project = create(:project) { |p| p.add_developer(user) } + master_project = create(:project) { |p| p.add_master(user) } expect(user.projects_where_can_admin_issues.to_a).to eq([master_project, developer_project, reporter_project]) expect(user.can?(:admin_issue, master_project)).to eq(true) @@ -1483,8 +1483,8 @@ describe User do end it 'does not include for which the user access level is below reporter' do - project = create(:empty_project) - guest_project = create(:empty_project) { |p| p.add_guest(user) } + project = create(:project) + guest_project = create(:project) { |p| p.add_guest(user) } expect(user.projects_where_can_admin_issues.to_a).to be_empty expect(user.can?(:admin_issue, guest_project)).to eq(false) @@ -1492,14 +1492,14 @@ describe User do end it 'does not include archived projects' do - project = create(:empty_project, :archived) + project = create(:project, :archived) expect(user.projects_where_can_admin_issues.to_a).to be_empty expect(user.can?(:admin_issue, project)).to eq(false) end it 'does not include projects for which issues are disabled' do - project = create(:empty_project, :issues_disabled) + project = create(:project, :issues_disabled) expect(user.projects_where_can_admin_issues.to_a).to be_empty expect(user.can?(:admin_issue, project)).to eq(false) @@ -1515,7 +1515,7 @@ describe User do end context 'without any projects' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } it 'does not load' do expect(user.ci_authorized_runners).to be_empty @@ -1524,7 +1524,7 @@ describe User do context 'with personal projects runners' do let(:namespace) { create(:namespace, owner: user) } - let(:project) { create(:empty_project, namespace: namespace) } + let(:project) { create(:project, namespace: namespace) } it 'loads' do expect(user.ci_authorized_runners).to contain_exactly(runner) @@ -1555,7 +1555,7 @@ describe User do context 'with groups projects runners' do let(:group) { create(:group) } - let(:project) { create(:empty_project, group: group) } + let(:project) { create(:project, group: group) } def add_user(access) group.add_user(user, access) @@ -1565,7 +1565,7 @@ describe User do end context 'with other projects runners' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } def add_user(access) project.team << [user, access] @@ -1576,8 +1576,8 @@ describe User do end describe '#projects_with_reporter_access_limited_to' do - let(:project1) { create(:empty_project) } - let(:project2) { create(:empty_project) } + let(:project1) { create(:project) } + let(:project2) { create(:project) } let(:user) { create(:user) } before do @@ -1719,8 +1719,8 @@ describe User do end describe '#refresh_authorized_projects', clean_gitlab_redis_shared_state: true do - let(:project1) { create(:empty_project) } - let(:project2) { create(:empty_project) } + let(:project1) { create(:project) } + let(:project2) { create(:project) } let(:user) { create(:user) } before do diff --git a/spec/models/wiki_page_spec.rb b/spec/models/wiki_page_spec.rb index 55d9c4ddd7b..b7eb412a8de 100644 --- a/spec/models/wiki_page_spec.rb +++ b/spec/models/wiki_page_spec.rb @@ -1,7 +1,7 @@ require "spec_helper" describe WikiPage do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { project.owner } let(:wiki) { ProjectWiki.new(project, user) } diff --git a/spec/policies/ci/build_policy_spec.rb b/spec/policies/ci/build_policy_spec.rb index 11a4c3c742e..8e1bc3d1543 100644 --- a/spec/policies/ci/build_policy_spec.rb +++ b/spec/policies/ci/build_policy_spec.rb @@ -17,7 +17,7 @@ describe Ci::BuildPolicy do describe '#rules' do context 'when user does not have access to the project' do - let(:project) { create(:empty_project, :private) } + let(:project) { create(:project, :private) } context 'when public builds are enabled' do it 'does not include ability to read build' do @@ -35,7 +35,7 @@ describe Ci::BuildPolicy do end context 'when anonymous user has access to the project' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } context 'when public builds are enabled' do it 'includes ability to read build' do @@ -53,7 +53,7 @@ describe Ci::BuildPolicy do end context 'when team member has access to the project' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } context 'team member is a guest' do before do diff --git a/spec/policies/ci/trigger_policy_spec.rb b/spec/policies/ci/trigger_policy_spec.rb index 3d3e3d3755b..be40dbb2aa9 100644 --- a/spec/policies/ci/trigger_policy_spec.rb +++ b/spec/policies/ci/trigger_policy_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Ci::TriggerPolicy do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:trigger) { create(:ci_trigger, project: project, owner: owner) } let(:policies) do diff --git a/spec/policies/issue_policy_spec.rb b/spec/policies/issue_policy_spec.rb index 279b96fb2af..be4c24c727c 100644 --- a/spec/policies/issue_policy_spec.rb +++ b/spec/policies/issue_policy_spec.rb @@ -14,7 +14,7 @@ describe IssuePolicy do context 'a private project' do let(:non_member) { create(:user) } - let(:project) { create(:empty_project, :private) } + let(:project) { create(:project, :private) } let(:issue) { create(:issue, project: project, assignees: [assignee], author: author) } let(:issue_no_assignee) { create(:issue, project: project) } @@ -109,7 +109,7 @@ describe IssuePolicy do end context 'a public project' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:issue) { create(:issue, project: project, assignees: [assignee], author: author) } let(:issue_no_assignee) { create(:issue, project: project) } diff --git a/spec/policies/project_policy_spec.rb b/spec/policies/project_policy_spec.rb index 1f51ced1beb..4dbaf7fb025 100644 --- a/spec/policies/project_policy_spec.rb +++ b/spec/policies/project_policy_spec.rb @@ -7,7 +7,7 @@ describe ProjectPolicy do let(:master) { create(:user) } let(:owner) { create(:user) } let(:admin) { create(:admin) } - let(:project) { create(:empty_project, :public, namespace: owner.namespace) } + let(:project) { create(:project, :public, namespace: owner.namespace) } let(:guest_permissions) do %i[ @@ -82,7 +82,7 @@ describe ProjectPolicy do end it 'does not include the read_issue permission when the issue author is not a member of the private project' do - project = create(:empty_project, :private) + project = create(:project, :private) issue = create(:issue, project: project) user = issue.author @@ -129,7 +129,7 @@ describe ProjectPolicy do context 'when a project has pending invites, and the current user is anonymous' do let(:group) { create(:group, :public) } - let(:project) { create(:empty_project, :public, namespace: group) } + let(:project) { create(:project, :public, namespace: group) } let(:user_permissions) { [:create_project, :create_issue, :create_note, :upload_file] } let(:anonymous_permissions) { guest_permissions - user_permissions } @@ -146,7 +146,7 @@ describe ProjectPolicy do end context 'abilities for non-public projects' do - let(:project) { create(:empty_project, namespace: owner.namespace) } + let(:project) { create(:project, namespace: owner.namespace) } subject { described_class.new(current_user, project) } diff --git a/spec/policies/project_snippet_policy_spec.rb b/spec/policies/project_snippet_policy_spec.rb index bae35ee31c6..f0bf46c480a 100644 --- a/spec/policies/project_snippet_policy_spec.rb +++ b/spec/policies/project_snippet_policy_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe ProjectSnippetPolicy do let(:regular_user) { create(:user) } let(:external_user) { create(:user, :external) } - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:author_permissions) do [ diff --git a/spec/presenters/ci/build_presenter_spec.rb b/spec/presenters/ci/build_presenter_spec.rb index f05d5c7fce5..a7a34ecac72 100644 --- a/spec/presenters/ci/build_presenter_spec.rb +++ b/spec/presenters/ci/build_presenter_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Ci::BuildPresenter do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:pipeline) { create(:ci_pipeline, project: project) } let(:build) { create(:ci_build, pipeline: pipeline) } @@ -85,7 +85,7 @@ describe Ci::BuildPresenter do describe 'quack like a Ci::Build permission-wise' do context 'user is not allowed' do - let(:project) { create(:empty_project, public_builds: false) } + let(:project) { create(:project, public_builds: false) } it 'returns false' do expect(presenter.can?(nil, :read_build)).to be_falsy @@ -93,7 +93,7 @@ describe Ci::BuildPresenter do end context 'user is allowed' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } it 'returns true' do expect(presenter.can?(nil, :read_build)).to be_truthy diff --git a/spec/presenters/ci/pipeline_presenter_spec.rb b/spec/presenters/ci/pipeline_presenter_spec.rb index 9134d1cc31c..e4886a8f019 100644 --- a/spec/presenters/ci/pipeline_presenter_spec.rb +++ b/spec/presenters/ci/pipeline_presenter_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Ci::PipelinePresenter do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:pipeline) { create(:ci_pipeline, project: project) } subject(:presenter) do diff --git a/spec/presenters/ci/variable_presenter_spec.rb b/spec/presenters/ci/variable_presenter_spec.rb index 9e6aae7bcad..db62f86edb0 100644 --- a/spec/presenters/ci/variable_presenter_spec.rb +++ b/spec/presenters/ci/variable_presenter_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Ci::VariablePresenter do include Gitlab::Routing.url_helpers - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:variable) { create(:ci_variable, project: project) } subject(:presenter) do diff --git a/spec/presenters/merge_request_presenter_spec.rb b/spec/presenters/merge_request_presenter_spec.rb index 0dd4ede5538..2187be0190d 100644 --- a/spec/presenters/merge_request_presenter_spec.rb +++ b/spec/presenters/merge_request_presenter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe MergeRequestPresenter do let(:resource) { create :merge_request, source_project: project } - let(:project) { create :empty_project } + let(:project) { create :project } let(:user) { create(:user) } describe '#ci_status' do @@ -71,7 +71,7 @@ describe MergeRequestPresenter do end describe '#conflict_resolution_path' do - let(:project) { create :empty_project } + let(:project) { create :project } let(:user) { create :user } let(:presenter) { described_class.new(resource, current_user: user) } let(:path) { presenter.conflict_resolution_path } diff --git a/spec/presenters/projects/settings/deploy_keys_presenter_spec.rb b/spec/presenters/projects/settings/deploy_keys_presenter_spec.rb index 5c39e1b5f96..2cc0076d695 100644 --- a/spec/presenters/projects/settings/deploy_keys_presenter_spec.rb +++ b/spec/presenters/projects/settings/deploy_keys_presenter_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Projects::Settings::DeployKeysPresenter do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } let(:deploy_key) { create(:deploy_key, public: true) } diff --git a/spec/requests/api/access_requests_spec.rb b/spec/requests/api/access_requests_spec.rb index c8eacb38e6f..6bd17697c33 100644 --- a/spec/requests/api/access_requests_spec.rb +++ b/spec/requests/api/access_requests_spec.rb @@ -7,7 +7,7 @@ describe API::AccessRequests do let(:stranger) { create(:user) } let(:project) do - create(:empty_project, :public, :access_requestable, creator_id: master.id, namespace: master.namespace) do |project| + create(:project, :public, :access_requestable, creator_id: master.id, namespace: master.namespace) do |project| project.team << [developer, :developer] project.team << [master, :master] project.request_access(access_requester) diff --git a/spec/requests/api/award_emoji_spec.rb b/spec/requests/api/award_emoji_spec.rb index 6d822b5cb4f..1dd9f3f6ddc 100644 --- a/spec/requests/api/award_emoji_spec.rb +++ b/spec/requests/api/award_emoji_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe API::AwardEmoji do let(:user) { create(:user) } - let!(:project) { create(:empty_project) } + let!(:project) { create(:project) } let(:issue) { create(:issue, project: project) } let!(:award_emoji) { create(:award_emoji, awardable: issue, user: user) } let!(:merge_request) { create(:merge_request, source_project: project, target_project: project) } diff --git a/spec/requests/api/boards_spec.rb b/spec/requests/api/boards_spec.rb index c27db716ef8..43b381c2219 100644 --- a/spec/requests/api/boards_spec.rb +++ b/spec/requests/api/boards_spec.rb @@ -6,7 +6,7 @@ describe API::Boards do let(:non_member) { create(:user) } let(:guest) { create(:user) } let(:admin) { create(:user, :admin) } - let!(:project) { create(:empty_project, :public, creator_id: user.id, namespace: user.namespace ) } + let!(:project) { create(:project, :public, creator_id: user.id, namespace: user.namespace ) } let!(:dev_label) do create(:label, title: 'Development', color: '#FFAABB', project: project) @@ -188,7 +188,7 @@ describe API::Boards do context "when the user is project owner" do let(:owner) { create(:user) } - let(:project) { create(:empty_project, namespace: owner.namespace) } + let(:project) { create(:project, namespace: owner.namespace) } it "deletes the list if an admin requests it" do delete api("#{base_url}/#{dev_list.id}", owner) diff --git a/spec/requests/api/deploy_keys_spec.rb b/spec/requests/api/deploy_keys_spec.rb index 32439981b60..d032d72de9c 100644 --- a/spec/requests/api/deploy_keys_spec.rb +++ b/spec/requests/api/deploy_keys_spec.rb @@ -3,8 +3,8 @@ require 'spec_helper' describe API::DeployKeys do let(:user) { create(:user) } let(:admin) { create(:admin) } - let(:project) { create(:empty_project, creator_id: user.id) } - let(:project2) { create(:empty_project, creator_id: user.id) } + let(:project) { create(:project, creator_id: user.id) } + let(:project2) { create(:project, creator_id: user.id) } let(:deploy_key) { create(:deploy_key, public: true) } let!(:deploy_keys_project) do @@ -193,7 +193,7 @@ describe API::DeployKeys do end describe 'POST /projects/:id/deploy_keys/:key_id/enable' do - let(:project2) { create(:empty_project) } + let(:project2) { create(:project) } context 'when the user can admin the project' do it 'enables the key' do diff --git a/spec/requests/api/environments_spec.rb b/spec/requests/api/environments_spec.rb index aae03c84e1f..4c5ded7a492 100644 --- a/spec/requests/api/environments_spec.rb +++ b/spec/requests/api/environments_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe API::Environments do let(:user) { create(:user) } let(:non_member) { create(:user) } - let(:project) { create(:empty_project, :private, namespace: user.namespace) } + let(:project) { create(:project, :private, namespace: user.namespace) } let!(:environment) { create(:environment, project: project) } before do diff --git a/spec/requests/api/events_spec.rb b/spec/requests/api/events_spec.rb index 1754ba66a96..7a847442469 100644 --- a/spec/requests/api/events_spec.rb +++ b/spec/requests/api/events_spec.rb @@ -5,7 +5,7 @@ describe API::Events do let(:user) { create(:user) } let(:non_member) { create(:user) } let(:other_user) { create(:user, username: 'otheruser') } - let(:private_project) { create(:empty_project, :private, creator_id: user.id, namespace: user.namespace) } + let(:private_project) { create(:project, :private, creator_id: user.id, namespace: user.namespace) } let(:closed_issue) { create(:closed_issue, project: private_project, author: user) } let!(:closed_issue_event) { create(:event, project: private_project, author: user, target: closed_issue, action: Event::CLOSED, created_at: Date.new(2016, 12, 30)) } @@ -60,7 +60,7 @@ describe API::Events do end context 'when there are multiple events from different projects' do - let(:second_note) { create(:note_on_issue, project: create(:empty_project)) } + let(:second_note) { create(:note_on_issue, project: create(:project)) } before do second_note.project.add_user(user, :developer) @@ -106,7 +106,7 @@ describe API::Events do end it 'returns 200 status for a public project' do - public_project = create(:empty_project, :public) + public_project = create(:project, :public) get api("/projects/#{public_project.id}/events") diff --git a/spec/requests/api/group_milestones_spec.rb b/spec/requests/api/group_milestones_spec.rb index 9b24658771f..108721c6655 100644 --- a/spec/requests/api/group_milestones_spec.rb +++ b/spec/requests/api/group_milestones_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe API::GroupMilestones do let(:user) { create(:user) } let(:group) { create(:group, :private) } - let(:project) { create(:empty_project, namespace: group) } + let(:project) { create(:project, namespace: group) } let!(:group_member) { create(:group_member, group: group, user: user) } let!(:closed_milestone) { create(:closed_milestone, group: group, title: 'version1', description: 'closed milestone') } let!(:milestone) { create(:milestone, group: group, title: 'version2', description: 'open milestone') } diff --git a/spec/requests/api/groups_spec.rb b/spec/requests/api/groups_spec.rb index 1d7adc6ac45..eba1db15da6 100644 --- a/spec/requests/api/groups_spec.rb +++ b/spec/requests/api/groups_spec.rb @@ -9,9 +9,9 @@ describe API::Groups do let(:admin) { create(:admin) } let!(:group1) { create(:group, avatar: File.open(uploaded_image_temp_path)) } let!(:group2) { create(:group, :private) } - let!(:project1) { create(:empty_project, namespace: group1) } - let!(:project2) { create(:empty_project, namespace: group2) } - let!(:project3) { create(:empty_project, namespace: group1, path: 'test', visibility_level: Gitlab::VisibilityLevel::PRIVATE) } + let!(:project1) { create(:project, namespace: group1) } + let!(:project2) { create(:project, namespace: group2) } + let!(:project3) { create(:project, namespace: group1, path: 'test', visibility_level: Gitlab::VisibilityLevel::PRIVATE) } before do group1.add_owner(user1) @@ -167,7 +167,7 @@ describe API::Groups do describe "GET /groups/:id" do context "when authenticated as user" do it "returns one of user1's groups" do - project = create(:empty_project, namespace: group2, path: 'Foo') + project = create(:project, namespace: group2, path: 'Foo') create(:project_group_link, project: project, group: group1) get api("/groups/#{group1.id}", user1) @@ -311,7 +311,7 @@ describe API::Groups do end it 'filters the groups projects' do - public_project = create(:empty_project, :public, path: 'test1', group: group1) + public_project = create(:project, :public, path: 'test1', group: group1) get api("/groups/#{group1.id}/projects", user1), visibility: 'public' @@ -509,7 +509,7 @@ describe API::Groups do end describe "POST /groups/:id/projects/:project_id" do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:project_path) { CGI.escape(project.full_path) } before(:each) do diff --git a/spec/requests/api/internal_spec.rb b/spec/requests/api/internal_spec.rb index fb312d3cb7d..8a2de23716f 100644 --- a/spec/requests/api/internal_spec.rb +++ b/spec/requests/api/internal_spec.rb @@ -350,7 +350,7 @@ describe API::Internal do end context "blocked user" do - let(:personal_project) { create(:empty_project, namespace: user.namespace) } + let(:personal_project) { create(:project, namespace: user.namespace) } before do user.block diff --git a/spec/requests/api/issues_spec.rb b/spec/requests/api/issues_spec.rb index 2c44be4e447..60687db9316 100644 --- a/spec/requests/api/issues_spec.rb +++ b/spec/requests/api/issues_spec.rb @@ -5,7 +5,7 @@ describe API::Issues do set(:user) { create(:user) } set(:project) do - create(:empty_project, :public, creator_id: user.id, namespace: user.namespace) + create(:project, :public, creator_id: user.id, namespace: user.namespace) end let(:user2) { create(:user) } @@ -296,7 +296,7 @@ describe API::Issues do describe "GET /groups/:id/issues" do let!(:group) { create(:group) } - let!(:group_project) { create(:empty_project, :public, creator_id: user.id, namespace: group) } + let!(:group_project) { create(:project, :public, creator_id: user.id, namespace: group) } let!(:group_closed_issue) do create :closed_issue, author: user, @@ -518,7 +518,7 @@ describe API::Issues do end it "returns 404 on private projects for other users" do - private_project = create(:empty_project, :private) + private_project = create(:project, :private) create(:issue, project: private_project) get api("/projects/#{private_project.id}/issues", non_member) @@ -527,7 +527,7 @@ describe API::Issues do end it 'returns no issues when user has access to project but not issues' do - restricted_project = create(:empty_project, :public, :issues_private) + restricted_project = create(:project, :public, :issues_private) create(:issue, project: restricted_project) get api("/projects/#{restricted_project.id}/issues", non_member) @@ -1299,7 +1299,7 @@ describe API::Issues do context "when the user is project owner" do let(:owner) { create(:user) } - let(:project) { create(:empty_project, namespace: owner.namespace) } + let(:project) { create(:project, namespace: owner.namespace) } it "deletes the issue if an admin requests it" do delete api("/projects/#{project.id}/issues/#{issue.iid}", owner) @@ -1324,8 +1324,8 @@ describe API::Issues do end describe '/projects/:id/issues/:issue_iid/move' do - let!(:target_project) { create(:empty_project, path: 'project2', creator_id: user.id, namespace: user.namespace ) } - let!(:target_project2) { create(:empty_project, creator_id: non_member.id, namespace: non_member.namespace ) } + let!(:target_project) { create(:project, path: 'project2', creator_id: user.id, namespace: user.namespace ) } + let!(:target_project2) { create(:project, creator_id: non_member.id, namespace: non_member.namespace ) } it 'moves an issue' do post api("/projects/#{project.id}/issues/#{issue.iid}/move", user), diff --git a/spec/requests/api/labels_spec.rb b/spec/requests/api/labels_spec.rb index f7e2f1908bb..5a4257d1009 100644 --- a/spec/requests/api/labels_spec.rb +++ b/spec/requests/api/labels_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe API::Labels do let(:user) { create(:user) } - let(:project) { create(:empty_project, creator_id: user.id, namespace: user.namespace) } + let(:project) { create(:project, creator_id: user.id, namespace: user.namespace) } let!(:label1) { create(:label, title: 'label1', project: project) } let!(:priority_label) { create(:label, title: 'bug', project: project, priority: 3) } diff --git a/spec/requests/api/members_spec.rb b/spec/requests/api/members_spec.rb index e095053fa03..06aca698c91 100644 --- a/spec/requests/api/members_spec.rb +++ b/spec/requests/api/members_spec.rb @@ -7,7 +7,7 @@ describe API::Members do let(:stranger) { create(:user) } let(:project) do - create(:empty_project, :public, :access_requestable, creator_id: master.id, namespace: master.namespace) do |project| + create(:project, :public, :access_requestable, creator_id: master.id, namespace: master.namespace) do |project| project.team << [developer, :developer] project.team << [master, :master] project.request_access(access_requester) diff --git a/spec/requests/api/merge_requests_spec.rb b/spec/requests/api/merge_requests_spec.rb index 2760c4ffde2..d8dfe71342d 100644 --- a/spec/requests/api/merge_requests_spec.rb +++ b/spec/requests/api/merge_requests_spec.rb @@ -36,7 +36,7 @@ describe API::MergeRequests do end context 'when authenticated' do - let!(:project2) { create(:empty_project, :public, namespace: user.namespace) } + let!(:project2) { create(:project, :public, namespace: user.namespace) } let!(:merge_request2) { create(:merge_request, :simple, author: user, assignee: user, source_project: project2, target_project: project2) } let(:user2) { create(:user) } @@ -51,7 +51,7 @@ describe API::MergeRequests do end it 'does not return unauthorized merge requests' do - private_project = create(:empty_project, :private) + private_project = create(:project, :private) merge_request3 = create(:merge_request, :simple, source_project: private_project, target_project: private_project, source_branch: 'other-branch') get api('/merge_requests', user), scope: :all @@ -557,8 +557,8 @@ describe API::MergeRequests do context 'forked projects' do let!(:user2) { create(:user) } - let!(:fork_project) { create(:empty_project, forked_from_project: project, namespace: user2.namespace, creator_id: user2.id) } - let!(:unrelated_project) { create(:empty_project, namespace: create(:user).namespace, creator_id: user2.id) } + let!(:fork_project) { create(:project, forked_from_project: project, namespace: user2.namespace, creator_id: user2.id) } + let!(:unrelated_project) { create(:project, namespace: create(:user).namespace, creator_id: user2.id) } before :each do |each| fork_project.team << [user2, :reporter] @@ -887,7 +887,7 @@ describe API::MergeRequests do end it 'handles external issues' do - jira_project = create(:jira_project, :public, name: 'JIR_EXT1') + jira_project = create(:jira_project, :public, :repository, name: 'JIR_EXT1') ext_issue = ExternalIssue.new("#{jira_project.name}-123", jira_project) issue = create(:issue, project: jira_project) description = "Closes #{ext_issue.to_reference(jira_project)}\ncloses #{issue.to_reference}" @@ -909,7 +909,7 @@ describe API::MergeRequests do end it 'returns 403 if the user has no access to the merge request' do - project = create(:empty_project, :private) + project = create(:project, :private) merge_request = create(:merge_request, :simple, source_project: project) guest = create(:user) project.team << [guest, :guest] diff --git a/spec/requests/api/notes_spec.rb b/spec/requests/api/notes_spec.rb index 4701ad585c9..75e5062a99c 100644 --- a/spec/requests/api/notes_spec.rb +++ b/spec/requests/api/notes_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe API::Notes do let(:user) { create(:user) } - let!(:project) { create(:empty_project, :public, namespace: user.namespace) } + let!(:project) { create(:project, :public, namespace: user.namespace) } let!(:issue) { create(:issue, project: project, author: user) } let!(:merge_request) { create(:merge_request, source_project: project, target_project: project, author: user) } let!(:snippet) { create(:project_snippet, project: project, author: user) } @@ -13,12 +13,12 @@ describe API::Notes do # For testing the cross-reference of a private issue in a public issue let(:private_user) { create(:user) } let(:private_project) do - create(:empty_project, namespace: private_user.namespace) + create(:project, namespace: private_user.namespace) .tap { |p| p.team << [private_user, :master] } end let(:private_issue) { create(:issue, project: private_project) } - let(:ext_proj) { create(:empty_project, :public) } + let(:ext_proj) { create(:project, :public) } let(:ext_issue) { create(:issue, project: ext_proj) } let!(:cross_reference_note) do @@ -272,7 +272,7 @@ describe API::Notes do context 'when user does not have access to read the noteable' do it 'responds with 404' do - project = create(:empty_project, :private) { |p| p.add_guest(user) } + project = create(:project, :private) { |p| p.add_guest(user) } issue = create(:issue, :confidential, project: project) post api("/projects/#{project.id}/issues/#{issue.iid}/notes", user), @@ -283,7 +283,7 @@ describe API::Notes do end context 'when user does not have access to create noteable' do - let(:private_issue) { create(:issue, project: create(:empty_project, :private)) } + let(:private_issue) { create(:issue, project: create(:project, :private)) } ## # We are posting to project user has access to, but we use issue id diff --git a/spec/requests/api/notification_settings_spec.rb b/spec/requests/api/notification_settings_spec.rb index d0e7a82e607..7968659a1ec 100644 --- a/spec/requests/api/notification_settings_spec.rb +++ b/spec/requests/api/notification_settings_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe API::NotificationSettings do let(:user) { create(:user) } let!(:group) { create(:group) } - let!(:project) { create(:empty_project, :public, creator_id: user.id, namespace: group) } + let!(:project) { create(:project, :public, creator_id: user.id, namespace: group) } describe "GET /notification_settings" do it "returns global notification settings for the current user" do diff --git a/spec/requests/api/project_hooks_spec.rb b/spec/requests/api/project_hooks_spec.rb index 0f9330b062d..2829c243af3 100644 --- a/spec/requests/api/project_hooks_spec.rb +++ b/spec/requests/api/project_hooks_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe API::ProjectHooks, 'ProjectHooks' do let(:user) { create(:user) } let(:user3) { create(:user) } - let!(:project) { create(:empty_project, creator_id: user.id, namespace: user.namespace) } + let!(:project) { create(:project, creator_id: user.id, namespace: user.namespace) } let!(:hook) do create(:project_hook, :all_events_enabled, @@ -205,7 +205,7 @@ describe API::ProjectHooks, 'ProjectHooks' do it "returns a 404 if a user attempts to delete project hooks he/she does not own" do test_user = create(:user) - other_project = create(:empty_project) + other_project = create(:project) other_project.team << [test_user, :master] delete api("/projects/#{other_project.id}/hooks/#{hook.id}", test_user) diff --git a/spec/requests/api/project_milestones_spec.rb b/spec/requests/api/project_milestones_spec.rb index fe8fdbfd7e4..72e1574b55f 100644 --- a/spec/requests/api/project_milestones_spec.rb +++ b/spec/requests/api/project_milestones_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe API::ProjectMilestones do let(:user) { create(:user) } - let!(:project) { create(:empty_project, namespace: user.namespace ) } + let!(:project) { create(:project, namespace: user.namespace ) } let!(:closed_milestone) { create(:closed_milestone, project: project, title: 'version1', description: 'closed milestone') } let!(:milestone) { create(:milestone, project: project, title: 'version2', description: 'open milestone') } diff --git a/spec/requests/api/project_snippets_spec.rb b/spec/requests/api/project_snippets_spec.rb index f220972bae3..2b541f5719e 100644 --- a/spec/requests/api/project_snippets_spec.rb +++ b/spec/requests/api/project_snippets_spec.rb @@ -1,7 +1,7 @@ require 'rails_helper' describe API::ProjectSnippets do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:user) { create(:user) } let(:admin) { create(:admin) } diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb index 6ed68fcff09..b9ebf6c4c16 100644 --- a/spec/requests/api/projects_spec.rb +++ b/spec/requests/api/projects_spec.rb @@ -8,8 +8,8 @@ describe API::Projects do let(:user2) { create(:user) } let(:user3) { create(:user) } let(:admin) { create(:admin) } - let(:project) { create(:empty_project, creator_id: user.id, namespace: user.namespace) } - let(:project2) { create(:empty_project, path: 'project2', creator_id: user.id, namespace: user.namespace) } + let(:project) { create(:project, creator_id: user.id, namespace: user.namespace) } + let(:project2) { create(:project, path: 'project2', creator_id: user.id, namespace: user.namespace) } let(:snippet) { create(:project_snippet, :public, author: user, project: project, title: 'example') } let(:project_member) { create(:project_member, :developer, user: user3, project: project) } let(:user4) { create(:user) } @@ -33,7 +33,7 @@ describe API::Projects do access_level: ProjectMember::MASTER) end let(:project4) do - create(:empty_project, + create(:project, name: 'third_project', path: 'third_project', creator_id: user4.id, @@ -61,7 +61,7 @@ describe API::Projects do if defined?(additional_project) additional_project else - create(:empty_project, :public) + create(:project, :public) end expect do @@ -70,7 +70,7 @@ describe API::Projects do end end - let!(:public_project) { create(:empty_project, :public, name: 'public_project') } + let!(:public_project) { create(:project, :public, name: 'public_project') } before do project project2 @@ -103,12 +103,12 @@ describe API::Projects do context 'when some projects are in a group' do before do - create(:empty_project, :public, group: create(:group)) + create(:project, :public, group: create(:group)) end it_behaves_like 'projects response without N + 1 queries' do let(:current_user) { user } - let(:additional_project) { create(:empty_project, :public, group: create(:group)) } + let(:additional_project) { create(:project, :public, group: create(:group)) } end end @@ -268,7 +268,7 @@ describe API::Projects do end context 'and with starred=true' do - let(:public_project) { create(:empty_project, :public) } + let(:public_project) { create(:project, :public) } before do project_member @@ -286,11 +286,11 @@ describe API::Projects do end context 'and with all query parameters' do - let!(:project5) { create(:empty_project, :public, path: 'gitlab5', namespace: create(:namespace)) } - let!(:project6) { create(:empty_project, :public, path: 'project6', namespace: user.namespace) } - let!(:project7) { create(:empty_project, :public, path: 'gitlab7', namespace: user.namespace) } - let!(:project8) { create(:empty_project, path: 'gitlab8', namespace: user.namespace) } - let!(:project9) { create(:empty_project, :public, path: 'gitlab9') } + let!(:project5) { create(:project, :public, path: 'gitlab5', namespace: create(:namespace)) } + let!(:project6) { create(:project, :public, path: 'project6', namespace: user.namespace) } + let!(:project7) { create(:project, :public, path: 'gitlab7', namespace: user.namespace) } + let!(:project8) { create(:project, path: 'gitlab8', namespace: user.namespace) } + let!(:project9) { create(:project, :public, path: 'gitlab9') } before do user.update_attributes(starred_projects: [project5, project7, project8, project9]) @@ -539,7 +539,7 @@ describe API::Projects do end describe 'GET /users/:user_id/projects/' do - let!(:public_project) { create(:empty_project, :public, name: 'public_project', creator_id: user4.id, namespace: user4.namespace) } + let!(:public_project) { create(:project, :public, name: 'public_project', creator_id: user4.id, namespace: user4.namespace) } it 'returns error when user not found' do get api('/users/9999/projects/') @@ -682,7 +682,7 @@ describe API::Projects do describe 'GET /projects/:id' do context 'when unauthenticated' do it 'returns the public projects' do - public_project = create(:empty_project, :public) + public_project = create(:project, :public) get api("/projects/#{public_project.id}") @@ -766,7 +766,7 @@ describe API::Projects do it 'handles users with dots' do dot_user = create(:user, username: 'dot.user') - project = create(:empty_project, creator_id: dot_user.id, namespace: dot_user.namespace) + project = create(:project, creator_id: dot_user.id, namespace: dot_user.namespace) get api("/projects/#{CGI.escape(project.full_path)}", dot_user) expect(response).to have_http_status(200) @@ -831,7 +831,7 @@ describe API::Projects do end it 'filters related URIs when their feature is not enabled' do - project = create(:empty_project, :public, + project = create(:project, :public, :merge_requests_disabled, :issues_disabled, creator_id: user.id, @@ -876,7 +876,7 @@ describe API::Projects do end context 'group project' do - let(:project2) { create(:empty_project, group: create(:group)) } + let(:project2) { create(:project, group: create(:group)) } before do project2.group.add_owner(user) @@ -916,7 +916,7 @@ describe API::Projects do context 'when unauthenticated' do it_behaves_like 'project users response' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:current_user) { nil } end end @@ -1036,11 +1036,11 @@ describe API::Projects do end describe 'fork management' do - let(:project_fork_target) { create(:empty_project) } - let(:project_fork_source) { create(:empty_project, :public) } + let(:project_fork_target) { create(:project) } + let(:project_fork_source) { create(:project, :public) } describe 'POST /projects/:id/fork/:forked_from_id' do - let(:new_project_fork_source) { create(:empty_project, :public) } + let(:new_project_fork_source) { create(:project, :public) } it "is not available for non admin users" do post api("/projects/#{project_fork_target.id}/fork/#{project_fork_source.id}", user) @@ -1081,7 +1081,7 @@ describe API::Projects do end context 'when users belong to project group' do - let(:project_fork_target) { create(:empty_project, group: create(:group)) } + let(:project_fork_target) { create(:project, group: create(:group)) } before do project_fork_target.group.add_owner user diff --git a/spec/requests/api/runner_spec.rb b/spec/requests/api/runner_spec.rb index ca5d98c78ef..edd6516cf34 100644 --- a/spec/requests/api/runner_spec.rb +++ b/spec/requests/api/runner_spec.rb @@ -42,7 +42,7 @@ describe API::Runner do end context 'when project token is used' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } it 'creates runner' do post api('/runners'), token: project.runners_token @@ -182,7 +182,7 @@ describe API::Runner do end describe '/api/v4/jobs' do - let(:project) { create(:empty_project, shared_runners_enabled: false) } + let(:project) { create(:project, shared_runners_enabled: false) } let(:pipeline) { create(:ci_pipeline_without_jobs, project: project, ref: 'master') } let(:runner) { create(:ci_runner) } let!(:job) do diff --git a/spec/requests/api/runners_spec.rb b/spec/requests/api/runners_spec.rb index 645a5389850..3a95db030d4 100644 --- a/spec/requests/api/runners_spec.rb +++ b/spec/requests/api/runners_spec.rb @@ -5,8 +5,8 @@ describe API::Runners do let(:user) { create(:user) } let(:user2) { create(:user) } - let(:project) { create(:empty_project, creator_id: user.id) } - let(:project2) { create(:empty_project, creator_id: user.id) } + let(:project) { create(:project, creator_id: user.id) } + let(:project2) { create(:project, creator_id: user.id) } let!(:shared_runner) { create(:ci_runner, :shared) } let!(:unused_specific_runner) { create(:ci_runner) } diff --git a/spec/requests/api/services_spec.rb b/spec/requests/api/services_spec.rb index 95df3429314..48d99841385 100644 --- a/spec/requests/api/services_spec.rb +++ b/spec/requests/api/services_spec.rb @@ -4,7 +4,7 @@ describe API::Services do let(:user) { create(:user) } let(:admin) { create(:admin) } let(:user2) { create(:user) } - let(:project) { create(:empty_project, creator_id: user.id, namespace: user.namespace) } + let(:project) { create(:project, creator_id: user.id, namespace: user.namespace) } Service.available_services_names.each do |service| describe "PUT /projects/:id/services/#{service.dasherize}" do @@ -98,7 +98,7 @@ describe API::Services do end describe 'POST /projects/:id/services/:slug/trigger' do - let!(:project) { create(:empty_project) } + let!(:project) { create(:project) } describe 'Mattermost Service' do let(:service_name) { 'mattermost_slash_commands' } diff --git a/spec/requests/api/todos_spec.rb b/spec/requests/api/todos_spec.rb index f5413913c1e..25d7f6dffcf 100644 --- a/spec/requests/api/todos_spec.rb +++ b/spec/requests/api/todos_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe API::Todos do let(:project_1) { create(:project, :repository) } - let(:project_2) { create(:empty_project) } + let(:project_2) { create(:project) } let(:author_1) { create(:user) } let(:author_2) { create(:user) } let(:john_doe) { create(:user, username: 'john_doe') } diff --git a/spec/requests/api/v3/award_emoji_spec.rb b/spec/requests/api/v3/award_emoji_spec.rb index 9234710f488..681e8e04295 100644 --- a/spec/requests/api/v3/award_emoji_spec.rb +++ b/spec/requests/api/v3/award_emoji_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe API::V3::AwardEmoji do let(:user) { create(:user) } - let!(:project) { create(:empty_project) } + let!(:project) { create(:project) } let(:issue) { create(:issue, project: project) } let!(:award_emoji) { create(:award_emoji, awardable: issue, user: user) } let!(:merge_request) { create(:merge_request, source_project: project, target_project: project) } diff --git a/spec/requests/api/v3/boards_spec.rb b/spec/requests/api/v3/boards_spec.rb index 4d786331d1b..b86aab2ec70 100644 --- a/spec/requests/api/v3/boards_spec.rb +++ b/spec/requests/api/v3/boards_spec.rb @@ -4,7 +4,7 @@ describe API::V3::Boards do let(:user) { create(:user) } let(:guest) { create(:user) } let(:non_member) { create(:user) } - let!(:project) { create(:empty_project, :public, creator_id: user.id, namespace: user.namespace ) } + let!(:project) { create(:project, :public, creator_id: user.id, namespace: user.namespace ) } let!(:dev_label) do create(:label, title: 'Development', color: '#FFAABB', project: project) @@ -99,7 +99,7 @@ describe API::V3::Boards do context "when the user is project owner" do let(:owner) { create(:user) } - let(:project) { create(:empty_project, namespace: owner.namespace) } + let(:project) { create(:project, namespace: owner.namespace) } it "deletes the list if an admin requests it" do delete v3_api("#{base_url}/#{dev_list.id}", owner) diff --git a/spec/requests/api/v3/deploy_keys_spec.rb b/spec/requests/api/v3/deploy_keys_spec.rb index 94f4d93a8dc..13a62423b1d 100644 --- a/spec/requests/api/v3/deploy_keys_spec.rb +++ b/spec/requests/api/v3/deploy_keys_spec.rb @@ -3,8 +3,8 @@ require 'spec_helper' describe API::V3::DeployKeys do let(:user) { create(:user) } let(:admin) { create(:admin) } - let(:project) { create(:empty_project, creator_id: user.id) } - let(:project2) { create(:empty_project, creator_id: user.id) } + let(:project) { create(:project, creator_id: user.id) } + let(:project2) { create(:project, creator_id: user.id) } let(:deploy_key) { create(:deploy_key, public: true) } let!(:deploy_keys_project) do @@ -133,7 +133,7 @@ describe API::V3::DeployKeys do end describe "POST /projects/:id/#{path}/:key_id/enable" do - let(:project2) { create(:empty_project) } + let(:project2) { create(:project) } context 'when the user can admin the project' do it 'enables the key' do diff --git a/spec/requests/api/v3/environments_spec.rb b/spec/requests/api/v3/environments_spec.rb index 99f35723974..39264e819a3 100644 --- a/spec/requests/api/v3/environments_spec.rb +++ b/spec/requests/api/v3/environments_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe API::V3::Environments do let(:user) { create(:user) } let(:non_member) { create(:user) } - let(:project) { create(:empty_project, :private, namespace: user.namespace) } + let(:project) { create(:project, :private, namespace: user.namespace) } let!(:environment) { create(:environment, project: project) } before do diff --git a/spec/requests/api/v3/groups_spec.rb b/spec/requests/api/v3/groups_spec.rb index 5cdc528e190..10756e494c3 100644 --- a/spec/requests/api/v3/groups_spec.rb +++ b/spec/requests/api/v3/groups_spec.rb @@ -9,9 +9,9 @@ describe API::V3::Groups do let(:admin) { create(:admin) } let!(:group1) { create(:group, avatar: File.open(uploaded_image_temp_path)) } let!(:group2) { create(:group, :private) } - let!(:project1) { create(:empty_project, namespace: group1) } - let!(:project2) { create(:empty_project, namespace: group2) } - let!(:project3) { create(:empty_project, namespace: group1, path: 'test', visibility_level: Gitlab::VisibilityLevel::PRIVATE) } + let!(:project1) { create(:project, namespace: group1) } + let!(:project2) { create(:project, namespace: group2) } + let!(:project3) { create(:project, namespace: group1, path: 'test', visibility_level: Gitlab::VisibilityLevel::PRIVATE) } before do group1.add_owner(user1) @@ -165,7 +165,7 @@ describe API::V3::Groups do describe "GET /groups/:id" do context "when authenticated as user" do it "returns one of user1's groups" do - project = create(:empty_project, namespace: group2, path: 'Foo') + project = create(:project, namespace: group2, path: 'Foo') create(:project_group_link, project: project, group: group1) get v3_api("/groups/#{group1.id}", user1) @@ -307,7 +307,7 @@ describe API::V3::Groups do end it 'filters the groups projects' do - public_project = create(:empty_project, :public, path: 'test1', group: group1) + public_project = create(:project, :public, path: 'test1', group: group1) get v3_api("/groups/#{group1.id}/projects", user1), visibility: 'public' @@ -501,7 +501,7 @@ describe API::V3::Groups do end describe "POST /groups/:id/projects/:project_id" do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:project_path) { CGI.escape(project.full_path) } before(:each) do diff --git a/spec/requests/api/v3/issues_spec.rb b/spec/requests/api/v3/issues_spec.rb index 4dff09b6df8..b092c863c8a 100644 --- a/spec/requests/api/v3/issues_spec.rb +++ b/spec/requests/api/v3/issues_spec.rb @@ -10,7 +10,7 @@ describe API::V3::Issues do let(:author) { create(:author) } let(:assignee) { create(:assignee) } let(:admin) { create(:user, :admin) } - let!(:project) { create(:empty_project, :public, creator_id: user.id, namespace: user.namespace ) } + let!(:project) { create(:project, :public, creator_id: user.id, namespace: user.namespace ) } let!(:closed_issue) do create :closed_issue, author: user, @@ -243,7 +243,7 @@ describe API::V3::Issues do describe "GET /groups/:id/issues" do let!(:group) { create(:group) } - let!(:group_project) { create(:empty_project, :public, creator_id: user.id, namespace: group) } + let!(:group_project) { create(:project, :public, creator_id: user.id, namespace: group) } let!(:group_closed_issue) do create :closed_issue, author: user, @@ -453,7 +453,7 @@ describe API::V3::Issues do end it "returns 404 on private projects for other users" do - private_project = create(:empty_project, :private) + private_project = create(:project, :private) create(:issue, project: private_project) get v3_api("/projects/#{private_project.id}/issues", non_member) @@ -462,7 +462,7 @@ describe API::V3::Issues do end it 'returns no issues when user has access to project but not issues' do - restricted_project = create(:empty_project, :public, issues_access_level: ProjectFeature::PRIVATE) + restricted_project = create(:project, :public, issues_access_level: ProjectFeature::PRIVATE) create(:issue, project: restricted_project) get v3_api("/projects/#{restricted_project.id}/issues", non_member) @@ -1172,7 +1172,7 @@ describe API::V3::Issues do context "when the user is project owner" do let(:owner) { create(:user) } - let(:project) { create(:empty_project, namespace: owner.namespace) } + let(:project) { create(:project, namespace: owner.namespace) } it "deletes the issue if an admin requests it" do delete v3_api("/projects/#{project.id}/issues/#{issue.id}", owner) @@ -1192,8 +1192,8 @@ describe API::V3::Issues do end describe '/projects/:id/issues/:issue_id/move' do - let!(:target_project) { create(:empty_project, path: 'project2', creator_id: user.id, namespace: user.namespace ) } - let!(:target_project2) { create(:empty_project, creator_id: non_member.id, namespace: non_member.namespace ) } + let!(:target_project) { create(:project, path: 'project2', creator_id: user.id, namespace: user.namespace ) } + let!(:target_project2) { create(:project, creator_id: non_member.id, namespace: non_member.namespace ) } it 'moves an issue' do post v3_api("/projects/#{project.id}/issues/#{issue.id}/move", user), diff --git a/spec/requests/api/v3/labels_spec.rb b/spec/requests/api/v3/labels_spec.rb index 62faa1cb129..32f37a08024 100644 --- a/spec/requests/api/v3/labels_spec.rb +++ b/spec/requests/api/v3/labels_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe API::V3::Labels do let(:user) { create(:user) } - let(:project) { create(:empty_project, creator_id: user.id, namespace: user.namespace) } + let(:project) { create(:project, creator_id: user.id, namespace: user.namespace) } let!(:label1) { create(:label, title: 'label1', project: project) } let!(:priority_label) { create(:label, title: 'bug', project: project, priority: 3) } diff --git a/spec/requests/api/v3/members_spec.rb b/spec/requests/api/v3/members_spec.rb index 623f02902b8..bc918a8eb02 100644 --- a/spec/requests/api/v3/members_spec.rb +++ b/spec/requests/api/v3/members_spec.rb @@ -7,7 +7,7 @@ describe API::V3::Members do let(:stranger) { create(:user) } let(:project) do - create(:empty_project, :public, :access_requestable, creator_id: master.id, namespace: master.namespace) do |project| + create(:project, :public, :access_requestable, creator_id: master.id, namespace: master.namespace) do |project| project.team << [developer, :developer] project.team << [master, :master] project.request_access(access_requester) diff --git a/spec/requests/api/v3/merge_requests_spec.rb b/spec/requests/api/v3/merge_requests_spec.rb index 4f9e63f2ace..ef7516fc28f 100644 --- a/spec/requests/api/v3/merge_requests_spec.rb +++ b/spec/requests/api/v3/merge_requests_spec.rb @@ -312,8 +312,8 @@ describe API::MergeRequests do context 'forked projects' do let!(:user2) { create(:user) } - let!(:fork_project) { create(:empty_project, forked_from_project: project, namespace: user2.namespace, creator_id: user2.id) } - let!(:unrelated_project) { create(:empty_project, namespace: create(:user).namespace, creator_id: user2.id) } + let!(:fork_project) { create(:project, forked_from_project: project, namespace: user2.namespace, creator_id: user2.id) } + let!(:unrelated_project) { create(:project, namespace: create(:user).namespace, creator_id: user2.id) } before :each do |each| fork_project.team << [user2, :reporter] @@ -635,7 +635,7 @@ describe API::MergeRequests do end it 'handles external issues' do - jira_project = create(:jira_project, :public, name: 'JIR_EXT1') + jira_project = create(:jira_project, :public, :repository, name: 'JIR_EXT1') issue = ExternalIssue.new("#{jira_project.name}-123", jira_project) merge_request = create(:merge_request, :simple, author: user, assignee: user, source_project: jira_project) merge_request.update_attribute(:description, "Closes #{issue.to_reference(jira_project)}") @@ -650,7 +650,7 @@ describe API::MergeRequests do end it 'returns 403 if the user has no access to the merge request' do - project = create(:empty_project, :private) + project = create(:project, :private, :repository) merge_request = create(:merge_request, :simple, source_project: project) guest = create(:user) project.team << [guest, :guest] diff --git a/spec/requests/api/v3/milestones_spec.rb b/spec/requests/api/v3/milestones_spec.rb index f04efc990a7..feaa87faec7 100644 --- a/spec/requests/api/v3/milestones_spec.rb +++ b/spec/requests/api/v3/milestones_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe API::V3::Milestones do let(:user) { create(:user) } - let!(:project) { create(:empty_project, namespace: user.namespace ) } + let!(:project) { create(:project, namespace: user.namespace ) } let!(:closed_milestone) { create(:closed_milestone, project: project) } let!(:milestone) { create(:milestone, project: project) } @@ -194,7 +194,7 @@ describe API::V3::Milestones do end describe 'confidential issues' do - let(:public_project) { create(:empty_project, :public) } + let(:public_project) { create(:project, :public) } let(:milestone) { create(:milestone, project: public_project) } let(:issue) { create(:issue, project: public_project) } let(:confidential_issue) { create(:issue, confidential: true, project: public_project) } diff --git a/spec/requests/api/v3/notes_spec.rb b/spec/requests/api/v3/notes_spec.rb index b5f98a9a545..56729692eed 100644 --- a/spec/requests/api/v3/notes_spec.rb +++ b/spec/requests/api/v3/notes_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe API::V3::Notes do let(:user) { create(:user) } - let!(:project) { create(:empty_project, :public, namespace: user.namespace) } + let!(:project) { create(:project, :public, namespace: user.namespace) } let!(:issue) { create(:issue, project: project, author: user) } let!(:merge_request) { create(:merge_request, source_project: project, target_project: project, author: user) } let!(:snippet) { create(:project_snippet, project: project, author: user) } @@ -13,12 +13,12 @@ describe API::V3::Notes do # For testing the cross-reference of a private issue in a public issue let(:private_user) { create(:user) } let(:private_project) do - create(:empty_project, namespace: private_user.namespace) + create(:project, namespace: private_user.namespace) .tap { |p| p.team << [private_user, :master] } end let(:private_issue) { create(:issue, project: private_project) } - let(:ext_proj) { create(:empty_project, :public) } + let(:ext_proj) { create(:project, :public) } let(:ext_issue) { create(:issue, project: ext_proj) } let!(:cross_reference_note) do @@ -268,7 +268,7 @@ describe API::V3::Notes do context 'when user does not have access to read the noteable' do it 'responds with 404' do - project = create(:empty_project, :private) { |p| p.add_guest(user) } + project = create(:project, :private) { |p| p.add_guest(user) } issue = create(:issue, :confidential, project: project) post v3_api("/projects/#{project.id}/issues/#{issue.id}/notes", user), @@ -279,7 +279,7 @@ describe API::V3::Notes do end context 'when user does not have access to create noteable' do - let(:private_issue) { create(:issue, project: create(:empty_project, :private)) } + let(:private_issue) { create(:issue, project: create(:project, :private)) } ## # We are posting to project user has access to, but we use issue id diff --git a/spec/requests/api/v3/project_hooks_spec.rb b/spec/requests/api/v3/project_hooks_spec.rb index e7014458773..b0eddbb5dd2 100644 --- a/spec/requests/api/v3/project_hooks_spec.rb +++ b/spec/requests/api/v3/project_hooks_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe API::ProjectHooks, 'ProjectHooks' do let(:user) { create(:user) } let(:user3) { create(:user) } - let!(:project) { create(:empty_project, creator_id: user.id, namespace: user.namespace) } + let!(:project) { create(:project, creator_id: user.id, namespace: user.namespace) } let!(:hook) do create(:project_hook, :all_events_enabled, @@ -204,7 +204,7 @@ describe API::ProjectHooks, 'ProjectHooks' do it "returns a 404 if a user attempts to delete project hooks he/she does not own" do test_user = create(:user) - other_project = create(:empty_project) + other_project = create(:project) other_project.team << [test_user, :master] delete v3_api("/projects/#{other_project.id}/hooks/#{hook.id}", test_user) diff --git a/spec/requests/api/v3/project_snippets_spec.rb b/spec/requests/api/v3/project_snippets_spec.rb index 1950c64c690..758fb482374 100644 --- a/spec/requests/api/v3/project_snippets_spec.rb +++ b/spec/requests/api/v3/project_snippets_spec.rb @@ -1,7 +1,7 @@ require 'rails_helper' describe API::ProjectSnippets do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:user) { create(:user) } let(:admin) { create(:admin) } diff --git a/spec/requests/api/v3/projects_spec.rb b/spec/requests/api/v3/projects_spec.rb index bbfcaab1ea1..c211cc20e53 100644 --- a/spec/requests/api/v3/projects_spec.rb +++ b/spec/requests/api/v3/projects_spec.rb @@ -7,8 +7,8 @@ describe API::V3::Projects do let(:user2) { create(:user) } let(:user3) { create(:user) } let(:admin) { create(:admin) } - let(:project) { create(:empty_project, creator_id: user.id, namespace: user.namespace) } - let(:project2) { create(:empty_project, path: 'project2', creator_id: user.id, namespace: user.namespace) } + let(:project) { create(:project, creator_id: user.id, namespace: user.namespace) } + let(:project2) { create(:project, path: 'project2', creator_id: user.id, namespace: user.namespace) } let(:snippet) { create(:project_snippet, :public, author: user, project: project, title: 'example') } let(:project_member) { create(:project_member, :developer, user: user3, project: project) } let(:user4) { create(:user) } @@ -31,7 +31,7 @@ describe API::V3::Projects do access_level: ProjectMember::MASTER) end let(:project4) do - create(:empty_project, + create(:project, name: 'third_project', path: 'third_project', creator_id: user4.id, @@ -125,7 +125,7 @@ describe API::V3::Projects do end context 'and using archived' do - let!(:archived_project) { create(:empty_project, creator_id: user.id, namespace: user.namespace, archived: true) } + let!(:archived_project) { create(:project, creator_id: user.id, namespace: user.namespace, archived: true) } it 'returns archived project' do get v3_api('/projects?archived=true', user) @@ -281,7 +281,7 @@ describe API::V3::Projects do end end - let!(:public_project) { create(:empty_project, :public) } + let!(:public_project) { create(:project, :public) } before do project project2 @@ -312,7 +312,7 @@ describe API::V3::Projects do end describe 'GET /projects/starred' do - let(:public_project) { create(:empty_project, :public) } + let(:public_project) { create(:project, :public) } before do project_member @@ -637,7 +637,7 @@ describe API::V3::Projects do describe 'GET /projects/:id' do context 'when unauthenticated' do it 'returns the public projects' do - public_project = create(:empty_project, :public) + public_project = create(:project, :public) get v3_api("/projects/#{public_project.id}") @@ -718,7 +718,7 @@ describe API::V3::Projects do it 'handles users with dots' do dot_user = create(:user, username: 'dot.user') - project = create(:empty_project, creator_id: dot_user.id, namespace: dot_user.namespace) + project = create(:project, creator_id: dot_user.id, namespace: dot_user.namespace) get v3_api("/projects/#{CGI.escape(project.full_path)}", dot_user) expect(response).to have_http_status(200) @@ -766,7 +766,7 @@ describe API::V3::Projects do end context 'group project' do - let(:project2) { create(:empty_project, group: create(:group)) } + let(:project2) { create(:project, group: create(:group)) } before { project2.group.add_owner(user) } @@ -811,7 +811,7 @@ describe API::V3::Projects do context 'when unauthenticated' do it_behaves_like 'project events response' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:current_user) { nil } end end @@ -861,7 +861,7 @@ describe API::V3::Projects do context 'when unauthenticated' do it_behaves_like 'project users response' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:current_user) { nil } end end @@ -975,11 +975,11 @@ describe API::V3::Projects do end describe 'fork management' do - let(:project_fork_target) { create(:empty_project) } - let(:project_fork_source) { create(:empty_project, :public) } + let(:project_fork_target) { create(:project) } + let(:project_fork_source) { create(:project, :public) } describe 'POST /projects/:id/fork/:forked_from_id' do - let(:new_project_fork_source) { create(:empty_project, :public) } + let(:new_project_fork_source) { create(:project, :public) } it "is not available for non admin users" do post v3_api("/projects/#{project_fork_target.id}/fork/#{project_fork_source.id}", user) @@ -1020,7 +1020,7 @@ describe API::V3::Projects do end context 'when users belong to project group' do - let(:project_fork_target) { create(:empty_project, group: create(:group)) } + let(:project_fork_target) { create(:project, group: create(:group)) } before do project_fork_target.group.add_owner user @@ -1140,16 +1140,16 @@ describe API::V3::Projects do describe 'GET /projects/search/:query' do let!(:query) { 'query'} - let!(:search) { create(:empty_project, name: query, creator_id: user.id, namespace: user.namespace) } - let!(:pre) { create(:empty_project, name: "pre_#{query}", creator_id: user.id, namespace: user.namespace) } - let!(:post) { create(:empty_project, name: "#{query}_post", creator_id: user.id, namespace: user.namespace) } - let!(:pre_post) { create(:empty_project, name: "pre_#{query}_post", creator_id: user.id, namespace: user.namespace) } - let!(:unfound) { create(:empty_project, name: 'unfound', creator_id: user.id, namespace: user.namespace) } - let!(:internal) { create(:empty_project, :internal, name: "internal #{query}") } - let!(:unfound_internal) { create(:empty_project, :internal, name: 'unfound internal') } - let!(:public) { create(:empty_project, :public, name: "public #{query}") } - let!(:unfound_public) { create(:empty_project, :public, name: 'unfound public') } - let!(:one_dot_two) { create(:empty_project, :public, name: "one.dot.two") } + let!(:search) { create(:project, name: query, creator_id: user.id, namespace: user.namespace) } + let!(:pre) { create(:project, name: "pre_#{query}", creator_id: user.id, namespace: user.namespace) } + let!(:post) { create(:project, name: "#{query}_post", creator_id: user.id, namespace: user.namespace) } + let!(:pre_post) { create(:project, name: "pre_#{query}_post", creator_id: user.id, namespace: user.namespace) } + let!(:unfound) { create(:project, name: 'unfound', creator_id: user.id, namespace: user.namespace) } + let!(:internal) { create(:project, :internal, name: "internal #{query}") } + let!(:unfound_internal) { create(:project, :internal, name: 'unfound internal') } + let!(:public) { create(:project, :public, name: "public #{query}") } + let!(:unfound_public) { create(:project, :public, name: 'unfound public') } + let!(:one_dot_two) { create(:project, :public, name: "one.dot.two") } shared_examples_for 'project search response' do |args = {}| it 'returns project search responses' do diff --git a/spec/requests/api/v3/runners_spec.rb b/spec/requests/api/v3/runners_spec.rb index dbda2cf34c3..78660afd840 100644 --- a/spec/requests/api/v3/runners_spec.rb +++ b/spec/requests/api/v3/runners_spec.rb @@ -5,8 +5,8 @@ describe API::V3::Runners do let(:user) { create(:user) } let(:user2) { create(:user) } - let(:project) { create(:empty_project, creator_id: user.id) } - let(:project2) { create(:empty_project, creator_id: user.id) } + let(:project) { create(:project, creator_id: user.id) } + let(:project2) { create(:project, creator_id: user.id) } let!(:shared_runner) { create(:ci_runner, :shared) } let!(:unused_specific_runner) { create(:ci_runner) } diff --git a/spec/requests/api/v3/services_spec.rb b/spec/requests/api/v3/services_spec.rb index 3ba62de822a..f0fa48e22df 100644 --- a/spec/requests/api/v3/services_spec.rb +++ b/spec/requests/api/v3/services_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" describe API::V3::Services do let(:user) { create(:user) } - let(:project) { create(:empty_project, creator_id: user.id, namespace: user.namespace) } + let(:project) { create(:project, creator_id: user.id, namespace: user.namespace) } available_services = Service.available_services_names available_services.delete('prometheus') diff --git a/spec/requests/api/v3/todos_spec.rb b/spec/requests/api/v3/todos_spec.rb index 9c2c4d64257..8f5c3fbf8dd 100644 --- a/spec/requests/api/v3/todos_spec.rb +++ b/spec/requests/api/v3/todos_spec.rb @@ -1,8 +1,8 @@ require 'spec_helper' describe API::V3::Todos do - let(:project_1) { create(:empty_project) } - let(:project_2) { create(:empty_project) } + let(:project_1) { create(:project) } + let(:project_2) { create(:project) } let(:author_1) { create(:user) } let(:author_2) { create(:user) } let(:john_doe) { create(:user, username: 'john_doe') } diff --git a/spec/requests/api/v3/triggers_spec.rb b/spec/requests/api/v3/triggers_spec.rb index 2a593dd8135..60212660fb6 100644 --- a/spec/requests/api/v3/triggers_spec.rb +++ b/spec/requests/api/v3/triggers_spec.rb @@ -10,7 +10,7 @@ describe API::V3::Triggers do let!(:trigger) { create(:ci_trigger, project: project, token: trigger_token) } describe 'POST /projects/:project_id/trigger' do - let!(:project2) { create(:empty_project) } + let!(:project2) { create(:project) } let(:options) do { token: trigger_token diff --git a/spec/requests/api/v3/users_spec.rb b/spec/requests/api/v3/users_spec.rb index de7499a4e43..bc0a4ab20a3 100644 --- a/spec/requests/api/v3/users_spec.rb +++ b/spec/requests/api/v3/users_spec.rb @@ -232,7 +232,7 @@ describe API::V3::Users do describe 'GET /users/:id/events' do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:note) { create(:note_on_issue, note: 'What an awesome day!', project: project) } before do @@ -276,7 +276,7 @@ describe API::V3::Users do end context 'when there are multiple events from different projects' do - let(:second_note) { create(:note_on_issue, project: create(:empty_project)) } + let(:second_note) { create(:note_on_issue, project: create(:project)) } let(:third_note) { create(:note_on_issue, project: project) } before do diff --git a/spec/requests/api/variables_spec.rb b/spec/requests/api/variables_spec.rb index e0975024b80..098a0d8ca7d 100644 --- a/spec/requests/api/variables_spec.rb +++ b/spec/requests/api/variables_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe API::Variables do let(:user) { create(:user) } let(:user2) { create(:user) } - let!(:project) { create(:empty_project, creator_id: user.id) } + let!(:project) { create(:project, creator_id: user.id) } let!(:master) { create(:project_member, :master, user: user, project: project) } let!(:developer) { create(:project_member, :developer, user: user2, project: project) } let!(:variable) { create(:ci_variable, project: project) } diff --git a/spec/requests/ci/api/builds_spec.rb b/spec/requests/ci/api/builds_spec.rb index 49e815ee16c..c077c458163 100644 --- a/spec/requests/ci/api/builds_spec.rb +++ b/spec/requests/ci/api/builds_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Ci::API::Builds do let(:runner) { FactoryGirl.create(:ci_runner, tag_list: %w(mysql ruby)) } - let(:project) { FactoryGirl.create(:empty_project, shared_runners_enabled: false) } + let(:project) { FactoryGirl.create(:project, shared_runners_enabled: false) } let(:last_update) { nil } describe "Builds API for runners" do diff --git a/spec/requests/ci/api/runners_spec.rb b/spec/requests/ci/api/runners_spec.rb index 78b2be350cd..75059dd20a0 100644 --- a/spec/requests/ci/api/runners_spec.rb +++ b/spec/requests/ci/api/runners_spec.rb @@ -70,7 +70,7 @@ describe Ci::API::Runners do end context 'when project token is provided' do - let(:project) { FactoryGirl.create(:empty_project) } + let(:project) { FactoryGirl.create(:project) } before do post ci_api("/runners/register"), token: project.runners_token diff --git a/spec/requests/ci/api/triggers_spec.rb b/spec/requests/ci/api/triggers_spec.rb index e481ca916ab..7c77ebb69a2 100644 --- a/spec/requests/ci/api/triggers_spec.rb +++ b/spec/requests/ci/api/triggers_spec.rb @@ -4,7 +4,7 @@ describe Ci::API::Triggers do describe 'POST /projects/:project_id/refs/:ref/trigger' do let!(:trigger_token) { 'secure token' } let!(:project) { create(:project, :repository, ci_id: 10) } - let!(:project2) { create(:empty_project, ci_id: 11) } + let!(:project2) { create(:project, ci_id: 11) } let!(:trigger) do create(:ci_trigger, diff --git a/spec/requests/git_http_spec.rb b/spec/requests/git_http_spec.rb index d5c16d8f601..ecac40e301b 100644 --- a/spec/requests/git_http_spec.rb +++ b/spec/requests/git_http_spec.rb @@ -573,7 +573,7 @@ describe 'Git HTTP requests' do context "when a gitlab ci token is provided" do let(:project) { create(:project, :repository) } let(:build) { create(:ci_build, :running) } - let(:other_project) { create(:empty_project) } + let(:other_project) { create(:project) } before do build.update!(project: project) # can't associate it on factory create @@ -622,7 +622,7 @@ describe 'Git HTTP requests' do it_behaves_like 'pulls are allowed' context 'when the repo does not exist' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } it 'rejects pulls with 403 Forbidden' do clone_get path, env diff --git a/spec/requests/lfs_http_spec.rb b/spec/requests/lfs_http_spec.rb index ff470a6cad0..27d09b8202e 100644 --- a/spec/requests/lfs_http_spec.rb +++ b/spec/requests/lfs_http_spec.rb @@ -20,7 +20,7 @@ describe 'Git LFS API and storage' do let(:sample_size) { lfs_object.size } describe 'when lfs is disabled' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:body) do { 'objects' => [ @@ -46,7 +46,7 @@ describe 'Git LFS API and storage' do end context 'project specific LFS settings' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:body) do { 'objects' => [ @@ -151,7 +151,7 @@ describe 'Git LFS API and storage' do end describe 'deprecated API' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } before do enable_lfs @@ -188,7 +188,7 @@ describe 'Git LFS API and storage' do end describe 'when fetching lfs object' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:update_permissions) { } before do @@ -281,7 +281,7 @@ describe 'Git LFS API and storage' do shared_examples 'can download LFS only from own projects' do context 'for owned project' do - let(:project) { create(:empty_project, namespace: user.namespace) } + let(:project) { create(:project, namespace: user.namespace) } let(:update_permissions) do project.lfs_objects << lfs_object @@ -302,7 +302,7 @@ describe 'Git LFS API and storage' do end context 'for other project' do - let(:other_project) { create(:empty_project) } + let(:other_project) { create(:project) } let(:pipeline) { create(:ci_empty_pipeline, project: other_project) } let(:update_permissions) do @@ -368,7 +368,7 @@ describe 'Git LFS API and storage' do end describe 'download' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:body) do { 'operation' => 'download', @@ -408,7 +408,7 @@ describe 'Git LFS API and storage' do end context 'when downloading an lfs object that is assigned to other project' do - let(:other_project) { create(:empty_project) } + let(:other_project) { create(:project) } let(:update_lfs_permissions) do other_project.lfs_objects << lfs_object end @@ -559,7 +559,7 @@ describe 'Git LFS API and storage' do end context 'for other project' do - let(:other_project) { create(:empty_project) } + let(:other_project) { create(:project) } let(:pipeline) { create(:ci_empty_pipeline, project: other_project) } it 'rejects downloading code' do @@ -600,7 +600,7 @@ describe 'Git LFS API and storage' do context 'when user is not authenticated' do describe 'is accessing public project' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:update_lfs_permissions) do project.lfs_objects << lfs_object @@ -642,7 +642,7 @@ describe 'Git LFS API and storage' do end describe 'upload' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:body) do { 'operation' => 'upload', @@ -662,7 +662,7 @@ describe 'Git LFS API and storage' do end context 'when pushing an lfs object that already exists' do - let(:other_project) { create(:empty_project) } + let(:other_project) { create(:project) } let(:update_lfs_permissions) do other_project.lfs_objects << lfs_object end @@ -765,7 +765,7 @@ describe 'Git LFS API and storage' do end context 'tries to push to other project' do - let(:other_project) { create(:empty_project) } + let(:other_project) { create(:project) } let(:pipeline) { create(:ci_empty_pipeline, project: other_project) } let(:build) { create(:ci_build, :running, pipeline: pipeline, user: user) } @@ -806,7 +806,7 @@ describe 'Git LFS API and storage' do end describe 'unsupported' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:authorization) { authorize_user } let(:body) do { @@ -894,7 +894,7 @@ describe 'Git LFS API and storage' do end describe 'to one project' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } describe 'when user is authenticated' do let(:authorization) { authorize_user } @@ -986,7 +986,7 @@ describe 'Git LFS API and storage' do end context 'tries to push to other project' do - let(:other_project) { create(:empty_project) } + let(:other_project) { create(:project) } let(:pipeline) { create(:ci_empty_pipeline, project: other_project) } let(:build) { create(:ci_build, :running, pipeline: pipeline, user: user) } @@ -1019,7 +1019,7 @@ describe 'Git LFS API and storage' do end describe 'to a forked project' do - let(:upstream_project) { create(:empty_project, :public) } + let(:upstream_project) { create(:project, :public) } let(:project_owner) { create(:user) } let(:project) { fork_project(upstream_project, project_owner) } @@ -1086,7 +1086,7 @@ describe 'Git LFS API and storage' do end context 'tries to push to other project' do - let(:other_project) { create(:empty_project) } + let(:other_project) { create(:project) } let(:pipeline) { create(:ci_empty_pipeline, project: other_project) } let(:build) { create(:ci_build, :running, pipeline: pipeline, user: user) } @@ -1111,7 +1111,7 @@ describe 'Git LFS API and storage' do end describe 'and second project not related to fork or a source project' do - let(:second_project) { create(:empty_project) } + let(:second_project) { create(:project) } let(:authorization) { authorize_user } before do diff --git a/spec/requests/request_profiler_spec.rb b/spec/requests/request_profiler_spec.rb index 1325ba37fd8..9afeb2983b0 100644 --- a/spec/requests/request_profiler_spec.rb +++ b/spec/requests/request_profiler_spec.rb @@ -13,7 +13,7 @@ describe 'Request Profiler' do end it 'creates a profile of the request' do - project = create(:empty_project, namespace: user.namespace) + project = create(:project, namespace: user.namespace) time = Time.now path = "/#{project.full_path}" diff --git a/spec/routing/environments_spec.rb b/spec/routing/environments_spec.rb index 9b70c2a24be..aacbe300966 100644 --- a/spec/routing/environments_spec.rb +++ b/spec/routing/environments_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe 'environments routing' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:environment) do create(:environment, project: project, diff --git a/spec/serializers/analytics_issue_entity_spec.rb b/spec/serializers/analytics_issue_entity_spec.rb index 75d606d5eb3..89588b4df2b 100644 --- a/spec/serializers/analytics_issue_entity_spec.rb +++ b/spec/serializers/analytics_issue_entity_spec.rb @@ -13,7 +13,7 @@ describe AnalyticsIssueEntity do } end - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:request) { EntityRequest.new(project: project, entity: :merge_request) } let(:entity) do diff --git a/spec/serializers/analytics_issue_serializer_spec.rb b/spec/serializers/analytics_issue_serializer_spec.rb index 7c14c198a74..5befc28f4fa 100644 --- a/spec/serializers/analytics_issue_serializer_spec.rb +++ b/spec/serializers/analytics_issue_serializer_spec.rb @@ -8,7 +8,7 @@ describe AnalyticsIssueSerializer do end let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:resource) do { total_time: "172802.724419", diff --git a/spec/serializers/analytics_merge_request_serializer_spec.rb b/spec/serializers/analytics_merge_request_serializer_spec.rb index 56cb08acfc6..62067cc0ef2 100644 --- a/spec/serializers/analytics_merge_request_serializer_spec.rb +++ b/spec/serializers/analytics_merge_request_serializer_spec.rb @@ -8,7 +8,7 @@ describe AnalyticsMergeRequestSerializer do end let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:resource) do { total_time: "172802.724419", diff --git a/spec/serializers/analytics_summary_serializer_spec.rb b/spec/serializers/analytics_summary_serializer_spec.rb index 5d7a94c2d02..236c244b402 100644 --- a/spec/serializers/analytics_summary_serializer_spec.rb +++ b/spec/serializers/analytics_summary_serializer_spec.rb @@ -5,7 +5,7 @@ describe AnalyticsSummarySerializer do described_class.new.represent(resource) end - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } let(:resource) do diff --git a/spec/serializers/build_details_entity_spec.rb b/spec/serializers/build_details_entity_spec.rb index 1332572fffc..5b7822d5d8e 100644 --- a/spec/serializers/build_details_entity_spec.rb +++ b/spec/serializers/build_details_entity_spec.rb @@ -57,7 +57,7 @@ describe BuildDetailsEntity do context 'when merge request is from a fork' do let(:fork_project) do - create(:empty_project, forked_from_project: project) + create(:project, forked_from_project: project) end let(:pipeline) { create(:ci_pipeline, project: fork_project) } diff --git a/spec/serializers/deploy_key_entity_spec.rb b/spec/serializers/deploy_key_entity_spec.rb index 8149de869f1..d3aefa2c9eb 100644 --- a/spec/serializers/deploy_key_entity_spec.rb +++ b/spec/serializers/deploy_key_entity_spec.rb @@ -4,9 +4,9 @@ describe DeployKeyEntity do include RequestAwareEntity let(:user) { create(:user) } - let(:project) { create(:empty_project, :internal)} - let(:project_private) { create(:empty_project, :private)} - let!(:project_pending_delete) { create(:empty_project, :internal, pending_delete: true) } + let(:project) { create(:project, :internal)} + let(:project_private) { create(:project, :private)} + let!(:project_pending_delete) { create(:project, :internal, pending_delete: true) } let(:deploy_key) { create(:deploy_key) } let!(:deploy_key_internal) { create(:deploy_keys_project, project: project, deploy_key: deploy_key) } let!(:deploy_key_private) { create(:deploy_keys_project, project: project_private, deploy_key: deploy_key) } diff --git a/spec/serializers/environment_serializer_spec.rb b/spec/serializers/environment_serializer_spec.rb index 4c52a00b442..ca9b520fb38 100644 --- a/spec/serializers/environment_serializer_spec.rb +++ b/spec/serializers/environment_serializer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe EnvironmentSerializer do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:json) do described_class @@ -39,7 +39,7 @@ describe EnvironmentSerializer do end context 'when there is a collection of objects provided' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:resource) { create_list(:environment, 2) } it 'contains important elements of environment' do diff --git a/spec/serializers/merge_request_entity_spec.rb b/spec/serializers/merge_request_entity_spec.rb index b3d58b2636f..18cd9e9c006 100644 --- a/spec/serializers/merge_request_entity_spec.rb +++ b/spec/serializers/merge_request_entity_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe MergeRequestEntity do - let(:project) { create :empty_project } + let(:project) { create :project } let(:resource) { create(:merge_request, source_project: project, target_project: project) } let(:user) { create(:user) } diff --git a/spec/serializers/pipeline_details_entity_spec.rb b/spec/serializers/pipeline_details_entity_spec.rb index b990370a271..f60d1843581 100644 --- a/spec/serializers/pipeline_details_entity_spec.rb +++ b/spec/serializers/pipeline_details_entity_spec.rb @@ -42,7 +42,7 @@ describe PipelineDetailsEntity do end context 'when pipeline is retryable' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:pipeline) do create(:ci_pipeline, status: :success, project: project) @@ -70,7 +70,7 @@ describe PipelineDetailsEntity do end context 'when pipeline is cancelable' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:pipeline) do create(:ci_pipeline, status: :running, project: project) diff --git a/spec/serializers/pipeline_entity_spec.rb b/spec/serializers/pipeline_entity_spec.rb index 5b01cc4fc9e..881f2b6bfd8 100644 --- a/spec/serializers/pipeline_entity_spec.rb +++ b/spec/serializers/pipeline_entity_spec.rb @@ -42,7 +42,7 @@ describe PipelineEntity do end context 'when pipeline is retryable' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:pipeline) do create(:ci_pipeline, status: :success, project: project) @@ -70,7 +70,7 @@ describe PipelineEntity do end context 'when pipeline is cancelable' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:pipeline) do create(:ci_pipeline, status: :running, project: project) diff --git a/spec/serializers/pipeline_serializer_spec.rb b/spec/serializers/pipeline_serializer_spec.rb index 262bc4acb69..362d754bca3 100644 --- a/spec/serializers/pipeline_serializer_spec.rb +++ b/spec/serializers/pipeline_serializer_spec.rb @@ -100,7 +100,7 @@ describe PipelineSerializer do context 'number of queries' do let(:resource) { Ci::Pipeline.all } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } before do Ci::Pipeline::AVAILABLE_STATUSES.each do |status| diff --git a/spec/serializers/runner_entity_spec.rb b/spec/serializers/runner_entity_spec.rb index 4f25a8dcfa0..439ba2cbca2 100644 --- a/spec/serializers/runner_entity_spec.rb +++ b/spec/serializers/runner_entity_spec.rb @@ -4,7 +4,7 @@ describe RunnerEntity do let(:runner) { create(:ci_runner, :specific) } let(:entity) { described_class.new(runner, request: request, current_user: user) } let(:request) { double('request') } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:admin) } before do diff --git a/spec/services/auth/container_registry_authentication_service_spec.rb b/spec/services/auth/container_registry_authentication_service_spec.rb index 0ae839ce0b3..d23c09d6d1d 100644 --- a/spec/services/auth/container_registry_authentication_service_spec.rb +++ b/spec/services/auth/container_registry_authentication_service_spec.rb @@ -96,7 +96,7 @@ describe Auth::ContainerRegistryAuthenticationService do end describe '#full_access_token' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:token) { described_class.full_access_token(project.full_path) } subject { { token: token } } @@ -112,7 +112,7 @@ describe Auth::ContainerRegistryAuthenticationService do let(:current_user) { create(:user) } context 'for private project' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } context 'allow to use scope-less authentication' do it_behaves_like 'a valid token' @@ -174,7 +174,7 @@ describe Auth::ContainerRegistryAuthenticationService do end context 'for public project' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } context 'allow anyone to pull images' do let(:current_params) do @@ -205,7 +205,7 @@ describe Auth::ContainerRegistryAuthenticationService do end context 'for internal project' do - let(:project) { create(:empty_project, :internal) } + let(:project) { create(:project, :internal) } context 'for internal user' do context 'allow anyone to pull images' do @@ -240,7 +240,7 @@ describe Auth::ContainerRegistryAuthenticationService do end context 'build authorized as user' do - let(:current_project) { create(:empty_project) } + let(:current_project) { create(:project) } let(:current_user) { create(:user) } let(:authentication_abilities) do @@ -274,7 +274,7 @@ describe Auth::ContainerRegistryAuthenticationService do end context 'allow for public' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } it_behaves_like 'a pullable' it_behaves_like 'not a container repository factory' @@ -296,7 +296,7 @@ describe Auth::ContainerRegistryAuthenticationService do end context 'when you are owner' do - let(:project) { create(:empty_project, namespace: current_user.namespace) } + let(:project) { create(:project, namespace: current_user.namespace) } it_behaves_like 'a pullable' it_behaves_like 'not a container repository factory' @@ -304,7 +304,7 @@ describe Auth::ContainerRegistryAuthenticationService do end context 'for private' do - let(:project) { create(:empty_project, :private) } + let(:project) { create(:project, :private) } it_behaves_like 'pullable for being team member' @@ -326,7 +326,7 @@ describe Auth::ContainerRegistryAuthenticationService do end context 'when you are owner' do - let(:project) { create(:empty_project, namespace: current_user.namespace) } + let(:project) { create(:project, namespace: current_user.namespace) } it_behaves_like 'a pullable' it_behaves_like 'not a container repository factory' @@ -342,7 +342,7 @@ describe Auth::ContainerRegistryAuthenticationService do context 'disallow for all' do context 'when you are member' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } before do project.team << [current_user, :developer] @@ -353,7 +353,7 @@ describe Auth::ContainerRegistryAuthenticationService do end context 'when you are owner' do - let(:project) { create(:empty_project, :public, namespace: current_user.namespace) } + let(:project) { create(:project, :public, namespace: current_user.namespace) } it_behaves_like 'an inaccessible' it_behaves_like 'not a container repository factory' @@ -363,7 +363,7 @@ describe Auth::ContainerRegistryAuthenticationService do end context 'for project without container registry' do - let(:project) { create(:empty_project, :public, container_registry_enabled: false) } + let(:project) { create(:project, :public, container_registry_enabled: false) } before do project.update(container_registry_enabled: false) @@ -396,7 +396,7 @@ describe Auth::ContainerRegistryAuthenticationService do end context 'for private project' do - let(:project) { create(:empty_project, :private) } + let(:project) { create(:project, :private) } let(:current_params) do { scope: "repository:#{project.full_path}:pull" } @@ -406,7 +406,7 @@ describe Auth::ContainerRegistryAuthenticationService do end context 'for public project' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } context 'when pulling and pushing' do let(:current_params) do diff --git a/spec/services/boards/create_service_spec.rb b/spec/services/boards/create_service_spec.rb index 6e3227303fe..db51a524e79 100644 --- a/spec/services/boards/create_service_spec.rb +++ b/spec/services/boards/create_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Boards::CreateService do describe '#execute' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } subject(:service) { described_class.new(project, double) } diff --git a/spec/services/boards/issues/create_service_spec.rb b/spec/services/boards/issues/create_service_spec.rb index 23ad66e454b..f2ddaa903da 100644 --- a/spec/services/boards/issues/create_service_spec.rb +++ b/spec/services/boards/issues/create_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Boards::Issues::CreateService do describe '#execute' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:board) { create(:board, project: project) } let(:user) { create(:user) } let(:label) { create(:label, project: project, name: 'in-progress') } diff --git a/spec/services/boards/issues/list_service_spec.rb b/spec/services/boards/issues/list_service_spec.rb index b1b5d807a78..01ee3856c99 100644 --- a/spec/services/boards/issues/list_service_spec.rb +++ b/spec/services/boards/issues/list_service_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Boards::Issues::ListService do describe '#execute' do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:board) { create(:board, project: project) } let(:bug) { create(:label, project: project, name: 'Bug') } diff --git a/spec/services/boards/issues/move_service_spec.rb b/spec/services/boards/issues/move_service_spec.rb index 15a32350ae2..63dfe80d672 100644 --- a/spec/services/boards/issues/move_service_spec.rb +++ b/spec/services/boards/issues/move_service_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Boards::Issues::MoveService do describe '#execute' do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:board1) { create(:board, project: project) } let(:bug) { create(:label, project: project, name: 'Bug') } diff --git a/spec/services/boards/list_service_spec.rb b/spec/services/boards/list_service_spec.rb index a95b12eeaa3..1d0be99fb35 100644 --- a/spec/services/boards/list_service_spec.rb +++ b/spec/services/boards/list_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Boards::ListService do describe '#execute' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } subject(:service) { described_class.new(project, double) } diff --git a/spec/services/boards/lists/create_service_spec.rb b/spec/services/boards/lists/create_service_spec.rb index 86d3227a78d..7d0b396cd06 100644 --- a/spec/services/boards/lists/create_service_spec.rb +++ b/spec/services/boards/lists/create_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Boards::Lists::CreateService do describe '#execute' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:board) { create(:board, project: project) } let(:user) { create(:user) } let(:label) { create(:label, project: project, name: 'in-progress') } diff --git a/spec/services/boards/lists/destroy_service_spec.rb b/spec/services/boards/lists/destroy_service_spec.rb index ad6ae83286d..bd98625b44f 100644 --- a/spec/services/boards/lists/destroy_service_spec.rb +++ b/spec/services/boards/lists/destroy_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Boards::Lists::DestroyService do describe '#execute' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:board) { create(:board, project: project) } let(:user) { create(:user) } diff --git a/spec/services/boards/lists/generate_service_spec.rb b/spec/services/boards/lists/generate_service_spec.rb index 7dec9f7a4a5..592f25059ac 100644 --- a/spec/services/boards/lists/generate_service_spec.rb +++ b/spec/services/boards/lists/generate_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Boards::Lists::GenerateService do describe '#execute' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:board) { create(:board, project: project) } let(:user) { create(:user) } diff --git a/spec/services/boards/lists/list_service_spec.rb b/spec/services/boards/lists/list_service_spec.rb index c93788d4516..b189857e4f4 100644 --- a/spec/services/boards/lists/list_service_spec.rb +++ b/spec/services/boards/lists/list_service_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Boards::Lists::ListService do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:board) { create(:board, project: project) } let(:label) { create(:label, project: project) } let!(:list) { create(:list, board: board, label: label) } diff --git a/spec/services/boards/lists/move_service_spec.rb b/spec/services/boards/lists/move_service_spec.rb index 43e125a21df..a9d218bad49 100644 --- a/spec/services/boards/lists/move_service_spec.rb +++ b/spec/services/boards/lists/move_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Boards::Lists::MoveService do describe '#execute' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:board) { create(:board, project: project) } let(:user) { create(:user) } diff --git a/spec/services/ci/pipeline_trigger_service_spec.rb b/spec/services/ci/pipeline_trigger_service_spec.rb index e9188a83b89..9a6875e448c 100644 --- a/spec/services/ci/pipeline_trigger_service_spec.rb +++ b/spec/services/ci/pipeline_trigger_service_spec.rb @@ -18,7 +18,7 @@ describe Ci::PipelineTriggerService do context 'when trigger belongs to a different project' do let(:params) { { token: trigger.token, ref: 'master', variables: nil } } - let(:trigger) { create(:ci_trigger, project: create(:empty_project), owner: user) } + let(:trigger) { create(:ci_trigger, project: create(:project), owner: user) } it 'does nothing' do expect { result }.not_to change { Ci::Pipeline.count } diff --git a/spec/services/ci/play_build_service_spec.rb b/spec/services/ci/play_build_service_spec.rb index 04f926ccb32..330ec81e87d 100644 --- a/spec/services/ci/play_build_service_spec.rb +++ b/spec/services/ci/play_build_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Ci::PlayBuildService, '#execute' do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:pipeline) { create(:ci_pipeline, project: project) } let(:build) { create(:ci_build, :manual, pipeline: pipeline) } @@ -11,7 +11,7 @@ describe Ci::PlayBuildService, '#execute' do end context 'when project does not have repository yet' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } it 'allows user to play build if protected branch rules are met' do project.add_developer(user) diff --git a/spec/services/ci/process_pipeline_service_spec.rb b/spec/services/ci/process_pipeline_service_spec.rb index 3a702742681..214adc9960f 100644 --- a/spec/services/ci/process_pipeline_service_spec.rb +++ b/spec/services/ci/process_pipeline_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Ci::ProcessPipelineService, '#execute' do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:pipeline) do create(:ci_empty_pipeline, ref: 'master', project: project) diff --git a/spec/services/ci/register_job_service_spec.rb b/spec/services/ci/register_job_service_spec.rb index 23c0f715c3e..8eb0d2d10a4 100644 --- a/spec/services/ci/register_job_service_spec.rb +++ b/spec/services/ci/register_job_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' module Ci describe RegisterJobService do - let!(:project) { FactoryGirl.create :empty_project, shared_runners_enabled: false } + let!(:project) { FactoryGirl.create :project, shared_runners_enabled: false } let!(:pipeline) { FactoryGirl.create :ci_pipeline, project: project } let!(:pending_build) { FactoryGirl.create :ci_build, pipeline: pipeline } let!(:shared_runner) { FactoryGirl.create(:ci_runner, is_shared: true) } @@ -72,9 +72,9 @@ module Ci end context 'for multiple builds' do - let!(:project2) { create :empty_project, shared_runners_enabled: true } + let!(:project2) { create :project, shared_runners_enabled: true } let!(:pipeline2) { create :ci_pipeline, project: project2 } - let!(:project3) { create :empty_project, shared_runners_enabled: true } + let!(:project3) { create :project, shared_runners_enabled: true } let!(:pipeline3) { create :ci_pipeline, project: project3 } let!(:build1_project1) { pending_build } let!(:build2_project1) { FactoryGirl.create :ci_build, pipeline: pipeline } diff --git a/spec/services/ci/retry_build_service_spec.rb b/spec/services/ci/retry_build_service_spec.rb index fd8a57d28f0..cec667071cc 100644 --- a/spec/services/ci/retry_build_service_spec.rb +++ b/spec/services/ci/retry_build_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Ci::RetryBuildService do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:pipeline) { create(:ci_pipeline, project: project) } let(:build) { create(:ci_build, pipeline: pipeline) } diff --git a/spec/services/ci/retry_pipeline_service_spec.rb b/spec/services/ci/retry_pipeline_service_spec.rb index 90b0c5a4dce..6ce75c65c8c 100644 --- a/spec/services/ci/retry_pipeline_service_spec.rb +++ b/spec/services/ci/retry_pipeline_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Ci::RetryPipelineService, '#execute' do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:pipeline) { create(:ci_pipeline, project: project) } let(:service) { described_class.new(project, user) } diff --git a/spec/services/event_create_service_spec.rb b/spec/services/event_create_service_spec.rb index 00104ae1fd9..42adb044190 100644 --- a/spec/services/event_create_service_spec.rb +++ b/spec/services/event_create_service_spec.rb @@ -114,7 +114,7 @@ describe EventCreateService do end describe '#push', :clean_gitlab_redis_shared_state do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } it 'creates a new event' do @@ -128,7 +128,7 @@ describe EventCreateService do describe 'Project' do let(:user) { create :user } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } describe '#join_project' do subject { service.join_project(project, user) } diff --git a/spec/services/groups/destroy_service_spec.rb b/spec/services/groups/destroy_service_spec.rb index c18870ea100..1b2ce3cd03e 100644 --- a/spec/services/groups/destroy_service_spec.rb +++ b/spec/services/groups/destroy_service_spec.rb @@ -6,7 +6,7 @@ describe Groups::DestroyService do let!(:user) { create(:user) } let!(:group) { create(:group) } let!(:nested_group) { create(:group, parent: group) } - let!(:project) { create(:empty_project, namespace: group) } + let!(:project) { create(:project, namespace: group) } let!(:notification_setting) { create(:notification_setting, source: group)} let!(:gitlab_shell) { Gitlab::Shell.new } let!(:remove_path) { group.path + "+#{group.id}+deleted" } diff --git a/spec/services/groups/update_service_spec.rb b/spec/services/groups/update_service_spec.rb index 9902e1aff8b..44f22a3b37b 100644 --- a/spec/services/groups/update_service_spec.rb +++ b/spec/services/groups/update_service_spec.rb @@ -13,7 +13,7 @@ describe Groups::UpdateService do before do public_group.add_user(user, Gitlab::Access::MASTER) - create(:empty_project, :public, group: public_group) + create(:project, :public, group: public_group) end it "does not change permission level" do @@ -27,7 +27,7 @@ describe Groups::UpdateService do before do internal_group.add_user(user, Gitlab::Access::MASTER) - create(:empty_project, :internal, group: internal_group) + create(:project, :internal, group: internal_group) end it "does not change permission level" do @@ -69,7 +69,7 @@ describe Groups::UpdateService do before do internal_group.add_user(user, Gitlab::Access::MASTER) - create(:empty_project, :internal, group: internal_group) + create(:project, :internal, group: internal_group) end it 'returns true' do diff --git a/spec/services/issuable/bulk_update_service_spec.rb b/spec/services/issuable/bulk_update_service_spec.rb index 055aa6156cb..befa65ec0f8 100644 --- a/spec/services/issuable/bulk_update_service_spec.rb +++ b/spec/services/issuable/bulk_update_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Issuable::BulkUpdateService do let(:user) { create(:user) } - let(:project) { create(:empty_project, namespace: user.namespace) } + let(:project) { create(:project, namespace: user.namespace) } def bulk_update(issuables, extra_params = {}) bulk_update_params = extra_params diff --git a/spec/services/issues/create_service_spec.rb b/spec/services/issues/create_service_spec.rb index a48748e274d..fcbd69fd58b 100644 --- a/spec/services/issues/create_service_spec.rb +++ b/spec/services/issues/create_service_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Issues::CreateService do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } describe '#execute' do diff --git a/spec/services/issues/duplicate_service_spec.rb b/spec/services/issues/duplicate_service_spec.rb index ed55664e382..089e77cc88b 100644 --- a/spec/services/issues/duplicate_service_spec.rb +++ b/spec/services/issues/duplicate_service_spec.rb @@ -2,8 +2,8 @@ require 'spec_helper' describe Issues::DuplicateService do let(:user) { create(:user) } - let(:canonical_project) { create(:empty_project) } - let(:duplicate_project) { create(:empty_project) } + let(:canonical_project) { create(:project) } + let(:duplicate_project) { create(:project) } let(:canonical_issue) { create(:issue, project: canonical_project) } let(:duplicate_issue) { create(:issue, project: duplicate_project) } diff --git a/spec/services/issues/move_service_spec.rb b/spec/services/issues/move_service_spec.rb index 171fc7334c4..f2b35a8fadf 100644 --- a/spec/services/issues/move_service_spec.rb +++ b/spec/services/issues/move_service_spec.rb @@ -5,8 +5,8 @@ describe Issues::MoveService do let(:author) { create(:user) } let(:title) { 'Some issue' } let(:description) { 'Some issue description' } - let(:old_project) { create(:empty_project) } - let(:new_project) { create(:empty_project) } + let(:old_project) { create(:project) } + let(:new_project) { create(:project) } let(:milestone1) { create(:milestone, project_id: old_project.id, title: 'v9.0') } let(:old_issue) do diff --git a/spec/services/issues/reopen_service_spec.rb b/spec/services/issues/reopen_service_spec.rb index 1ff988e9b47..205e9ebd237 100644 --- a/spec/services/issues/reopen_service_spec.rb +++ b/spec/services/issues/reopen_service_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Issues::ReopenService do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:issue) { create(:issue, :closed, project: project) } describe '#execute' do diff --git a/spec/services/issues/update_service_spec.rb b/spec/services/issues/update_service_spec.rb index eec2096fa34..ff0d876e6da 100644 --- a/spec/services/issues/update_service_spec.rb +++ b/spec/services/issues/update_service_spec.rb @@ -7,7 +7,7 @@ describe Issues::UpdateService do let(:user) { create(:user) } let(:user2) { create(:user) } let(:user3) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:label) { create(:label, project: project) } let(:label2) { create(:label) } diff --git a/spec/services/labels/create_service_spec.rb b/spec/services/labels/create_service_spec.rb index 9ff3a5375b9..438e6dbc628 100644 --- a/spec/services/labels/create_service_spec.rb +++ b/spec/services/labels/create_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Labels::CreateService do describe '#execute' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:group) { create(:group) } let(:hex_color) { '#FF0000' } diff --git a/spec/services/labels/find_or_create_service_spec.rb b/spec/services/labels/find_or_create_service_spec.rb index 2d3a15a1c11..a781fbc7f7d 100644 --- a/spec/services/labels/find_or_create_service_spec.rb +++ b/spec/services/labels/find_or_create_service_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Labels::FindOrCreateService do describe '#execute' do let(:group) { create(:group) } - let(:project) { create(:empty_project, namespace: group) } + let(:project) { create(:project, namespace: group) } let(:params) do { diff --git a/spec/services/labels/promote_service_spec.rb b/spec/services/labels/promote_service_spec.rb index 7cea877ad88..8809b282127 100644 --- a/spec/services/labels/promote_service_spec.rb +++ b/spec/services/labels/promote_service_spec.rb @@ -5,7 +5,7 @@ describe Labels::PromoteService do let!(:user) { create(:user) } context 'project without group' do - let!(:project_1) { create(:empty_project) } + let!(:project_1) { create(:project) } let!(:project_label_1_1) { create(:label, project: project_1) } @@ -27,10 +27,10 @@ describe Labels::PromoteService do let!(:group_1) { create(:group) } let!(:group_2) { create(:group) } - let!(:project_1) { create(:empty_project, namespace: group_1) } - let!(:project_2) { create(:empty_project, namespace: group_1) } - let!(:project_3) { create(:empty_project, namespace: group_1) } - let!(:project_4) { create(:empty_project, namespace: group_2) } + let!(:project_1) { create(:project, namespace: group_1) } + let!(:project_2) { create(:project, namespace: group_1) } + let!(:project_3) { create(:project, namespace: group_1) } + let!(:project_4) { create(:project, namespace: group_2) } # Labels/issues can't be lazily created so we might as well eager initialize # all other objects too since we use them inside diff --git a/spec/services/labels/transfer_service_spec.rb b/spec/services/labels/transfer_service_spec.rb index f70edd3d16e..ae819c011de 100644 --- a/spec/services/labels/transfer_service_spec.rb +++ b/spec/services/labels/transfer_service_spec.rb @@ -6,8 +6,8 @@ describe Labels::TransferService do let(:group_1) { create(:group) } let(:group_2) { create(:group) } let(:group_3) { create(:group) } - let(:project_1) { create(:empty_project, namespace: group_2) } - let(:project_2) { create(:empty_project, namespace: group_3) } + let(:project_1) { create(:project, namespace: group_2) } + let(:project_2) { create(:project, namespace: group_3) } let(:group_label_1) { create(:group_label, group: group_1, name: 'Group Label 1') } let(:group_label_2) { create(:group_label, group: group_1, name: 'Group Label 2') } diff --git a/spec/services/labels/update_service_spec.rb b/spec/services/labels/update_service_spec.rb index f0bec7e9f9c..bb95fe20fbf 100644 --- a/spec/services/labels/update_service_spec.rb +++ b/spec/services/labels/update_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Labels::UpdateService do describe '#execute' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:hex_color) { '#FF0000' } let(:named_color) { 'red' } diff --git a/spec/services/members/approve_access_request_service_spec.rb b/spec/services/members/approve_access_request_service_spec.rb index ddba96b8d03..302c488d6c6 100644 --- a/spec/services/members/approve_access_request_service_spec.rb +++ b/spec/services/members/approve_access_request_service_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Members::ApproveAccessRequestService do let(:user) { create(:user) } let(:access_requester) { create(:user) } - let(:project) { create(:empty_project, :public, :access_requestable) } + let(:project) { create(:project, :public, :access_requestable) } let(:group) { create(:group, :public, :access_requestable) } let(:opts) { {} } diff --git a/spec/services/members/authorized_destroy_service_spec.rb b/spec/services/members/authorized_destroy_service_spec.rb index f0abbc46ca3..2d04d824180 100644 --- a/spec/services/members/authorized_destroy_service_spec.rb +++ b/spec/services/members/authorized_destroy_service_spec.rb @@ -2,9 +2,9 @@ require 'spec_helper' describe Members::AuthorizedDestroyService do let(:member_user) { create(:user) } - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:group) { create(:group, :public) } - let(:group_project) { create(:empty_project, :public, group: group) } + let(:group_project) { create(:project, :public, group: group) } def number_of_assigned_issuables(user) Issue.assigned_to(user).count + MergeRequest.assigned_to(user).count diff --git a/spec/services/members/create_service_spec.rb b/spec/services/members/create_service_spec.rb index c73a229823d..2a793e0eb4d 100644 --- a/spec/services/members/create_service_spec.rb +++ b/spec/services/members/create_service_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Members::CreateService do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } let(:project_user) { create(:user) } diff --git a/spec/services/members/destroy_service_spec.rb b/spec/services/members/destroy_service_spec.rb index 0e30b343eaf..72f5e27180d 100644 --- a/spec/services/members/destroy_service_spec.rb +++ b/spec/services/members/destroy_service_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Members::DestroyService do let(:user) { create(:user) } let(:member_user) { create(:user) } - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:group) { create(:group, :public) } shared_examples 'a service raising ActiveRecord::RecordNotFound' do diff --git a/spec/services/members/request_access_service_spec.rb b/spec/services/members/request_access_service_spec.rb index f39d4f47904..0a704bba521 100644 --- a/spec/services/members/request_access_service_spec.rb +++ b/spec/services/members/request_access_service_spec.rb @@ -29,7 +29,7 @@ describe Members::RequestAccessService do end context 'when current user cannot request access to the project' do - %i[empty_project group].each do |source_type| + %i[project group].each do |source_type| it_behaves_like 'a service raising Gitlab::Access::AccessDeniedError' do let(:source) { create(source_type, :private) } end @@ -37,7 +37,7 @@ describe Members::RequestAccessService do end context 'when access requests are disabled' do - %i[empty_project group].each do |source_type| + %i[project group].each do |source_type| it_behaves_like 'a service raising Gitlab::Access::AccessDeniedError' do let(:source) { create(source_type, :public) } end @@ -45,7 +45,7 @@ describe Members::RequestAccessService do end context 'when current user can request access to the project' do - %i[empty_project group].each do |source_type| + %i[project group].each do |source_type| it_behaves_like 'a service creating a access request' do let(:source) { create(source_type, :public, :access_requestable) } end diff --git a/spec/services/merge_requests/build_service_spec.rb b/spec/services/merge_requests/build_service_spec.rb index ea192e51f89..b46c419de14 100644 --- a/spec/services/merge_requests/build_service_spec.rb +++ b/spec/services/merge_requests/build_service_spec.rb @@ -264,8 +264,8 @@ describe MergeRequests::BuildService do end context 'upstream project has disabled merge requests' do - let(:upstream_project) { create(:empty_project, :merge_requests_disabled) } - let(:project) { create(:empty_project, forked_from_project: upstream_project) } + let(:upstream_project) { create(:project, :merge_requests_disabled) } + let(:project) { create(:project, forked_from_project: upstream_project) } let(:commits) { Commit.decorate([commit_1], project) } it 'sets target project correctly' do diff --git a/spec/services/milestones/close_service_spec.rb b/spec/services/milestones/close_service_spec.rb index fa0686d8061..2bdf224804d 100644 --- a/spec/services/milestones/close_service_spec.rb +++ b/spec/services/milestones/close_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Milestones::CloseService do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:milestone) { create(:milestone, title: "Milestone v1.2", project: project) } before do diff --git a/spec/services/milestones/create_service_spec.rb b/spec/services/milestones/create_service_spec.rb index c6fe8e65912..8837b91051d 100644 --- a/spec/services/milestones/create_service_spec.rb +++ b/spec/services/milestones/create_service_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Milestones::CreateService do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } describe '#execute' do diff --git a/spec/services/milestones/destroy_service_spec.rb b/spec/services/milestones/destroy_service_spec.rb index f7a6c3d323e..5739386dd0d 100644 --- a/spec/services/milestones/destroy_service_spec.rb +++ b/spec/services/milestones/destroy_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Milestones::DestroyService do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:milestone) { create(:milestone, title: 'Milestone v1.0', project: project) } let(:issue) { create(:issue, project: project, milestone: milestone) } let(:merge_request) { create(:merge_request, source_project: project, milestone: milestone) } diff --git a/spec/services/note_summary_spec.rb b/spec/services/note_summary_spec.rb index dda579c7080..a6cc2251e48 100644 --- a/spec/services/note_summary_spec.rb +++ b/spec/services/note_summary_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe NoteSummary do - let(:project) { build(:empty_project) } + let(:project) { build(:project) } let(:noteable) { build(:issue) } let(:user) { build(:user) } diff --git a/spec/services/notes/create_service_spec.rb b/spec/services/notes/create_service_spec.rb index c08a5a940bb..661d26946e7 100644 --- a/spec/services/notes/create_service_spec.rb +++ b/spec/services/notes/create_service_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Notes::CreateService do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:issue) { create(:issue, project: project) } let(:user) { create(:user) } let(:opts) do diff --git a/spec/services/notes/destroy_service_spec.rb b/spec/services/notes/destroy_service_spec.rb index 4330190caaa..c9a99a43edb 100644 --- a/spec/services/notes/destroy_service_spec.rb +++ b/spec/services/notes/destroy_service_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Notes::DestroyService do describe '#execute' do it 'deletes a note' do - project = create(:empty_project) + project = create(:project) issue = create(:issue, project: project) note = create(:note, project: project, noteable: issue) diff --git a/spec/services/notes/post_process_service_spec.rb b/spec/services/notes/post_process_service_spec.rb index bf9320e5fce..a2b3638059f 100644 --- a/spec/services/notes/post_process_service_spec.rb +++ b/spec/services/notes/post_process_service_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Notes::PostProcessService do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:issue) { create(:issue, project: project) } let(:user) { create(:user) } diff --git a/spec/services/notes/quick_actions_service_spec.rb b/spec/services/notes/quick_actions_service_spec.rb index fc4cd3dc2b7..0280a19098b 100644 --- a/spec/services/notes/quick_actions_service_spec.rb +++ b/spec/services/notes/quick_actions_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Notes::QuickActionsService do shared_context 'note on noteable' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:master) { create(:user).tap { |u| project.team << [u, :master] } } let(:assignee) { create(:user) } @@ -225,7 +225,7 @@ describe Notes::QuickActionsService do context 'CE restriction for issue assignees' do describe '/assign' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:master) { create(:user).tap { |u| project.team << [u, :master] } } let(:assignee) { create(:user) } let(:master) { create(:user) } diff --git a/spec/services/notes/update_service_spec.rb b/spec/services/notes/update_service_spec.rb index dea2dc02d00..3210539f3ee 100644 --- a/spec/services/notes/update_service_spec.rb +++ b/spec/services/notes/update_service_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Notes::UpdateService do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } let(:user2) { create(:user) } let(:user3) { create(:user) } diff --git a/spec/services/notification_recipient_service_spec.rb b/spec/services/notification_recipient_service_spec.rb index 77233dc1b2f..0eb0771fd29 100644 --- a/spec/services/notification_recipient_service_spec.rb +++ b/spec/services/notification_recipient_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe NotificationRecipientService do set(:user) { create(:user) } - set(:project) { create(:empty_project, :public) } + set(:project) { create(:project, :public) } set(:issue) { create(:issue, project: project) } set(:watcher) do diff --git a/spec/services/notification_service_spec.rb b/spec/services/notification_service_spec.rb index 5b69426cbaa..882ee7751b5 100644 --- a/spec/services/notification_service_spec.rb +++ b/spec/services/notification_service_spec.rb @@ -119,7 +119,7 @@ describe NotificationService do describe 'Notes' do context 'issue note' do - let(:project) { create(:empty_project, :private) } + let(:project) { create(:project, :private) } let(:issue) { create(:issue, project: project, assignees: [assignee]) } let(:mentioned_issue) { create(:issue, assignees: issue.assignees) } let(:note) { create(:note_on_issue, noteable: issue, project_id: issue.project_id, note: '@mention referenced, @outsider also') } @@ -228,7 +228,7 @@ describe NotificationService do end context 'confidential issue note' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:author) { create(:user) } let(:assignee) { create(:user) } let(:non_member) { create(:user) } @@ -260,7 +260,7 @@ describe NotificationService do end context 'issue note mention' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:issue) { create(:issue, project: project, assignees: [assignee]) } let(:mentioned_issue) { create(:issue, assignees: issue.assignees) } let(:note) { create(:note_on_issue, noteable: issue, project_id: issue.project_id, note: '@all mentioned') } @@ -303,7 +303,7 @@ describe NotificationService do end context 'project snippet note' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:snippet) { create(:project_snippet, project: project, author: create(:user)) } let(:note) { create(:note_on_project_snippet, noteable: snippet, project_id: snippet.project.id, note: '@all mentioned') } @@ -464,8 +464,8 @@ describe NotificationService do describe 'Issues' do let(:group) { create(:group) } - let(:project) { create(:empty_project, :public, namespace: group) } - let(:another_project) { create(:empty_project, :public, namespace: group) } + let(:project) { create(:project, :public, namespace: group) } + let(:another_project) { create(:project, :public, namespace: group) } let(:issue) { create :issue, project: project, assignees: [assignee], description: 'cc @participant' } before do @@ -855,7 +855,7 @@ describe NotificationService do describe 'Merge Requests' do let(:group) { create(:group) } let(:project) { create(:project, :public, :repository, namespace: group) } - let(:another_project) { create(:empty_project, :public, namespace: group) } + let(:another_project) { create(:project, :public, namespace: group) } let(:merge_request) { create :merge_request, source_project: project, assignee: create(:user), description: 'cc @participant' } before do @@ -1150,7 +1150,7 @@ describe NotificationService do end describe 'Projects' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } before do build_team(project) @@ -1211,7 +1211,7 @@ describe NotificationService do describe 'ProjectMember' do describe '#decline_group_invite' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:member) { create(:user) } before(:each) do @@ -1229,7 +1229,7 @@ describe NotificationService do end context 'guest user in private project' do - let(:private_project) { create(:empty_project, :private) } + let(:private_project) { create(:project, :private) } let(:guest) { create(:user) } let(:developer) { create(:user) } let(:assignee) { create(:user) } diff --git a/spec/services/preview_markdown_service_spec.rb b/spec/services/preview_markdown_service_spec.rb index 4fd9cb23ae1..64a9559791f 100644 --- a/spec/services/preview_markdown_service_spec.rb +++ b/spec/services/preview_markdown_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe PreviewMarkdownService do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } before do project.add_developer(user) diff --git a/spec/services/projects/autocomplete_service_spec.rb b/spec/services/projects/autocomplete_service_spec.rb index fc7238862ab..c1f098530bf 100644 --- a/spec/services/projects/autocomplete_service_spec.rb +++ b/spec/services/projects/autocomplete_service_spec.rb @@ -8,7 +8,7 @@ describe Projects::AutocompleteService do let(:non_member) { create(:user) } let(:member) { create(:user) } let(:admin) { create(:admin) } - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let!(:issue) { create(:issue, project: project, title: 'Issue 1') } let!(:security_issue_1) { create(:issue, :confidential, project: project, title: 'Security issue 1', author: author) } let!(:security_issue_2) { create(:issue, :confidential, title: 'Security issue 2', project: project, assignees: [assignee]) } diff --git a/spec/services/projects/download_service_spec.rb b/spec/services/projects/download_service_spec.rb index 701f6cc8c6a..da236052ebf 100644 --- a/spec/services/projects/download_service_spec.rb +++ b/spec/services/projects/download_service_spec.rb @@ -4,7 +4,7 @@ describe Projects::DownloadService do describe 'File service' do before do @user = create(:user) - @project = create(:empty_project, creator_id: @user.id, namespace: @user.namespace) + @project = create(:project, creator_id: @user.id, namespace: @user.namespace) end context 'for a URL that is not on whitelist' do diff --git a/spec/services/projects/enable_deploy_key_service_spec.rb b/spec/services/projects/enable_deploy_key_service_spec.rb index 9b8c24ba112..835dae68fcd 100644 --- a/spec/services/projects/enable_deploy_key_service_spec.rb +++ b/spec/services/projects/enable_deploy_key_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Projects::EnableDeployKeyService do let(:deploy_key) { create(:deploy_key, public: true) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { project.creator} let!(:params) { { key_id: deploy_key.id } } diff --git a/spec/services/projects/import_service_spec.rb b/spec/services/projects/import_service_spec.rb index c2a6cafa4c8..c0ab1ea704d 100644 --- a/spec/services/projects/import_service_spec.rb +++ b/spec/services/projects/import_service_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Projects::ImportService do - let!(:project) { create(:empty_project) } + let!(:project) { create(:project) } let(:user) { project.creator } subject { described_class.new(project, user) } diff --git a/spec/services/projects/participants_service_spec.rb b/spec/services/projects/participants_service_spec.rb index 8777e63a101..0d18ceb8ff8 100644 --- a/spec/services/projects/participants_service_spec.rb +++ b/spec/services/projects/participants_service_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Projects::ParticipantsService do describe '#groups' do describe 'avatar_url' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:group) { create(:group, avatar: fixture_file_upload(Rails.root + 'spec/fixtures/dk.png')) } let(:user) { create(:user) } let!(:group_member) { create(:group_member, group: group, user: user) } diff --git a/spec/services/projects/propagate_service_template_spec.rb b/spec/services/projects/propagate_service_template_spec.rb index 2763437f184..f4c59735c43 100644 --- a/spec/services/projects/propagate_service_template_spec.rb +++ b/spec/services/projects/propagate_service_template_spec.rb @@ -15,7 +15,7 @@ describe Projects::PropagateServiceTemplate do }) end - let!(:project) { create(:empty_project) } + let!(:project) { create(:project) } it 'creates services for projects' do expect(project.pushover_service).to be_nil @@ -76,7 +76,7 @@ describe Projects::PropagateServiceTemplate do before do stub_const 'Projects::PropagateServiceTemplate::BATCH_SIZE', 3 - project_total.times { create(:empty_project) } + project_total.times { create(:project) } described_class.propagate(service_template) end diff --git a/spec/services/projects/update_pages_configuration_service_spec.rb b/spec/services/projects/update_pages_configuration_service_spec.rb index 42925e73978..e4d4e6ff3dd 100644 --- a/spec/services/projects/update_pages_configuration_service_spec.rb +++ b/spec/services/projects/update_pages_configuration_service_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Projects::UpdatePagesConfigurationService do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } subject { described_class.new(project) } describe "#update" do diff --git a/spec/services/projects/update_service_spec.rb b/spec/services/projects/update_service_spec.rb index d7b0df9a671..d945e0aa1f0 100644 --- a/spec/services/projects/update_service_spec.rb +++ b/spec/services/projects/update_service_spec.rb @@ -5,7 +5,7 @@ describe Projects::UpdateService, '#execute' do let(:admin) { create(:admin) } let(:project) do - create(:empty_project, creator: user, namespace: user.namespace) + create(:project, creator: user, namespace: user.namespace) end context 'when changing visibility level' do @@ -59,7 +59,7 @@ describe Projects::UpdateService, '#execute' do end describe 'when updating project that has forks' do - let(:project) { create(:empty_project, :internal) } + let(:project) { create(:project, :internal) } let(:forked_project) { create(:forked_project_with_submodules, :internal) } before do diff --git a/spec/services/protected_branches/create_service_spec.rb b/spec/services/protected_branches/create_service_spec.rb index 592f9b5929e..835e83d6dba 100644 --- a/spec/services/protected_branches/create_service_spec.rb +++ b/spec/services/protected_branches/create_service_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe ProtectedBranches::CreateService do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { project.owner } let(:params) do { diff --git a/spec/services/protected_tags/create_service_spec.rb b/spec/services/protected_tags/create_service_spec.rb index 3a3cc9c1573..c3ed95aaebf 100644 --- a/spec/services/protected_tags/create_service_spec.rb +++ b/spec/services/protected_tags/create_service_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe ProtectedTags::CreateService do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { project.owner } let(:params) do { diff --git a/spec/services/quick_actions/interpret_service_spec.rb b/spec/services/quick_actions/interpret_service_spec.rb index 92bde2c92bf..b78ecfb61c4 100644 --- a/spec/services/quick_actions/interpret_service_spec.rb +++ b/spec/services/quick_actions/interpret_service_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe QuickActions::InterpretService do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:developer) { create(:user) } let(:developer2) { create(:user) } let(:issue) { create(:issue, project: project) } @@ -683,7 +683,7 @@ describe QuickActions::InterpretService do context 'cross project references' do it_behaves_like 'duplicate command' do - let(:other_project) { create(:empty_project, :public) } + let(:other_project) { create(:project, :public) } let(:issue_duplicate) { create(:issue, project: other_project) } let(:content) { "/duplicate #{issue_duplicate.to_reference(project)}" } let(:issuable) { issue } @@ -695,7 +695,7 @@ describe QuickActions::InterpretService do end it_behaves_like 'empty command' do - let(:other_project) { create(:empty_project, :private) } + let(:other_project) { create(:project, :private) } let(:issue_duplicate) { create(:issue, project: other_project) } let(:content) { "/duplicate #{issue_duplicate.to_reference(project)}" } diff --git a/spec/services/search/global_service_spec.rb b/spec/services/search/global_service_spec.rb index de921573b1a..1309240b430 100644 --- a/spec/services/search/global_service_spec.rb +++ b/spec/services/search/global_service_spec.rb @@ -4,10 +4,10 @@ describe Search::GlobalService do let(:user) { create(:user) } let(:internal_user) { create(:user) } - let!(:found_project) { create(:empty_project, :private, name: 'searchable_project') } - let!(:unfound_project) { create(:empty_project, :private, name: 'unfound_project') } - let!(:internal_project) { create(:empty_project, :internal, name: 'searchable_internal_project') } - let!(:public_project) { create(:empty_project, :public, name: 'searchable_public_project') } + let!(:found_project) { create(:project, :private, name: 'searchable_project') } + let!(:unfound_project) { create(:project, :private, name: 'unfound_project') } + let!(:internal_project) { create(:project, :internal, name: 'searchable_internal_project') } + let!(:public_project) { create(:project, :public, name: 'searchable_public_project') } before do found_project.add_master(user) diff --git a/spec/services/search/group_service_spec.rb b/spec/services/search/group_service_spec.rb index cb3f02d2883..cbc553a60cf 100644 --- a/spec/services/search/group_service_spec.rb +++ b/spec/services/search/group_service_spec.rb @@ -8,14 +8,14 @@ describe Search::GroupService do let(:nested_group) { create(:group, :nested) } # These projects shouldn't be found - let!(:outside_project) { create(:empty_project, :public, name: "Outside #{term}") } - let!(:private_project) { create(:empty_project, :private, namespace: nested_group, name: "Private #{term}" )} - let!(:other_project) { create(:empty_project, :public, namespace: nested_group, name: term.reverse) } + let!(:outside_project) { create(:project, :public, name: "Outside #{term}") } + let!(:private_project) { create(:project, :private, namespace: nested_group, name: "Private #{term}" )} + let!(:other_project) { create(:project, :public, namespace: nested_group, name: term.reverse) } # These projects should be found - let!(:project1) { create(:empty_project, :internal, namespace: nested_group, name: "Inner #{term} 1") } - let!(:project2) { create(:empty_project, :internal, namespace: nested_group, name: "Inner #{term} 2") } - let!(:project3) { create(:empty_project, :internal, namespace: nested_group.parent, name: "Outer #{term}") } + let!(:project1) { create(:project, :internal, namespace: nested_group, name: "Inner #{term} 1") } + let!(:project2) { create(:project, :internal, namespace: nested_group, name: "Inner #{term} 2") } + let!(:project3) { create(:project, :internal, namespace: nested_group.parent, name: "Outer #{term}") } let(:results) { described_class.new(user, search_group, search: term).execute } subject { results.objects('projects') } diff --git a/spec/services/search/snippet_service_spec.rb b/spec/services/search/snippet_service_spec.rb index 69438a3fa36..eae9bd4f5cf 100644 --- a/spec/services/search/snippet_service_spec.rb +++ b/spec/services/search/snippet_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Search::SnippetService do let(:author) { create(:author) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let!(:public_snippet) { create(:snippet, :public, content: 'password: XXX') } let!(:internal_snippet) { create(:snippet, :internal, content: 'password: XXX') } diff --git a/spec/services/search_service_spec.rb b/spec/services/search_service_spec.rb index a6ef7561bc8..02de83a2df8 100644 --- a/spec/services/search_service_spec.rb +++ b/spec/services/search_service_spec.rb @@ -7,13 +7,13 @@ describe SearchService do let(:inaccessible_group) { create(:group, :private) } let!(:group_member) { create(:group_member, group: accessible_group, user: user) } - let!(:accessible_project) { create(:empty_project, :private, name: 'accessible_project') } - let!(:inaccessible_project) { create(:empty_project, :private, name: 'inaccessible_project') } + let!(:accessible_project) { create(:project, :private, name: 'accessible_project') } + let!(:inaccessible_project) { create(:project, :private, name: 'inaccessible_project') } let(:note) { create(:note_on_issue, project: accessible_project) } let(:snippet) { create(:snippet, author: user) } - let(:group_project) { create(:empty_project, group: accessible_group, name: 'group_project') } - let(:public_project) { create(:empty_project, :public, name: 'public_project') } + let(:group_project) { create(:project, group: accessible_group, name: 'group_project') } + let(:public_project) { create(:project, :public, name: 'public_project') } before do accessible_project.add_master(user) @@ -28,7 +28,7 @@ describe SearchService do end it 'returns the project for guests' do - search_project = create :empty_project + search_project = create :project search_project.add_guest(user) project = described_class.new(user, project_id: search_project.id).project diff --git a/spec/services/spam_service_spec.rb b/spec/services/spam_service_spec.rb index 46349c3e951..a14dfa3f01f 100644 --- a/spec/services/spam_service_spec.rb +++ b/spec/services/spam_service_spec.rb @@ -15,7 +15,7 @@ describe SpamService do end context 'when recaptcha was not verified' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:issue) { create(:issue, project: project) } let(:request) { double(:request, env: {}) } diff --git a/spec/services/system_hooks_service_spec.rb b/spec/services/system_hooks_service_spec.rb index b2d9862e71e..8b5d9187785 100644 --- a/spec/services/system_hooks_service_spec.rb +++ b/spec/services/system_hooks_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe SystemHooksService do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:project_member) { create(:project_member) } let(:key) { create(:key, user: user) } let(:deploy_key) { create(:key) } diff --git a/spec/services/system_note_service_spec.rb b/spec/services/system_note_service_spec.rb index 5c20263a532..e3805160b04 100644 --- a/spec/services/system_note_service_spec.rb +++ b/spec/services/system_note_service_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe SystemNoteService do include Gitlab::Routing - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:author) { create(:user) } let(:noteable) { create(:issue, project: project) } let(:issue) { noteable } @@ -648,7 +648,7 @@ describe SystemNoteService do end describe '.noteable_moved' do - let(:new_project) { create(:empty_project) } + let(:new_project) { create(:project) } let(:new_noteable) { create(:issue, project: new_project) } subject do @@ -718,7 +718,7 @@ describe SystemNoteService do describe 'JIRA integration' do include JiraServiceHelper - let(:project) { create(:jira_project) } + let(:project) { create(:jira_project, :repository) } let(:author) { create(:user) } let(:issue) { create(:issue, project: project) } let(:merge_request) { create(:merge_request, :simple, target_project: project, source_project: project) } @@ -1116,7 +1116,7 @@ describe SystemNoteService do end context 'across different projects' do - let(:other_project) { create(:empty_project) } + let(:other_project) { create(:project) } let(:canonical_issue) { create(:issue, project: other_project) } it_behaves_like 'a system note' do @@ -1141,7 +1141,7 @@ describe SystemNoteService do end context 'across different projects' do - let(:other_project) { create(:empty_project) } + let(:other_project) { create(:project) } let(:duplicate_issue) { create(:issue, project: other_project) } it_behaves_like 'a system note' do diff --git a/spec/services/todo_service_spec.rb b/spec/services/todo_service_spec.rb index 230e40de9e0..534d3e65be2 100644 --- a/spec/services/todo_service_spec.rb +++ b/spec/services/todo_service_spec.rb @@ -10,7 +10,7 @@ describe TodoService do let(:john_doe) { create(:user) } let(:skipped) { create(:user) } let(:skip_users) { [skipped] } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:mentions) { 'FYI: ' + [author, assignee, john_doe, member, guest, non_member, admin, skipped].map(&:to_reference).join(' ') } let(:directly_addressed) { [author, assignee, john_doe, member, guest, non_member, admin, skipped].map(&:to_reference).join(' ') } let(:directly_addressed_and_mentioned) { member.to_reference + ", what do you think? cc: " + [guest, admin, skipped].map(&:to_reference).join(' ') } @@ -103,7 +103,7 @@ describe TodoService do context 'when a private group is mentioned' do let(:group) { create(:group, :private) } - let(:project) { create(:empty_project, :private, group: group) } + let(:project) { create(:project, :private, group: group) } let(:issue) { create(:issue, author: author, project: project, description: group.to_reference) } before do diff --git a/spec/services/upload_service_spec.rb b/spec/services/upload_service_spec.rb index cf76a18f171..24f3a5c5ff0 100644 --- a/spec/services/upload_service_spec.rb +++ b/spec/services/upload_service_spec.rb @@ -4,7 +4,7 @@ describe UploadService do describe 'File service' do before do @user = create(:user) - @project = create(:empty_project, creator_id: @user.id, namespace: @user.namespace) + @project = create(:project, creator_id: @user.id, namespace: @user.namespace) end context 'for valid gif file' do diff --git a/spec/services/users/destroy_service_spec.rb b/spec/services/users/destroy_service_spec.rb index db30fe2c24e..a82567f6f43 100644 --- a/spec/services/users/destroy_service_spec.rb +++ b/spec/services/users/destroy_service_spec.rb @@ -5,7 +5,7 @@ describe Users::DestroyService do let!(:user) { create(:user) } let!(:admin) { create(:admin) } let!(:namespace) { create(:namespace, owner: user) } - let!(:project) { create(:empty_project, namespace: namespace) } + let!(:project) { create(:project, namespace: namespace) } let(:service) { described_class.new(admin) } context 'no options are given' do @@ -40,7 +40,7 @@ describe Users::DestroyService do end context "a deleted user's issues" do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } before do project.add_developer(user) diff --git a/spec/services/users/refresh_authorized_projects_service_spec.rb b/spec/services/users/refresh_authorized_projects_service_spec.rb index 1c0f55d2965..08fd26d67fd 100644 --- a/spec/services/users/refresh_authorized_projects_service_spec.rb +++ b/spec/services/users/refresh_authorized_projects_service_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Users::RefreshAuthorizedProjectsService do # We're using let! here so that any expectations for the service class are not # triggered twice. - let!(:project) { create(:empty_project) } + let!(:project) { create(:project) } let(:user) { project.namespace.owner } let(:service) { described_class.new(user) } @@ -28,7 +28,7 @@ describe Users::RefreshAuthorizedProjectsService do end it 'updates the authorized projects of the user' do - project2 = create(:empty_project) + project2 = create(:project) to_remove = user.project_authorizations .create!(project: project2, access_level: Gitlab::Access::MASTER) @@ -109,7 +109,7 @@ describe Users::RefreshAuthorizedProjectsService do end context 'projects the user is a member of' do - let!(:other_project) { create(:empty_project) } + let!(:other_project) { create(:project) } before do other_project.team.add_reporter(user) @@ -122,7 +122,7 @@ describe Users::RefreshAuthorizedProjectsService do context 'projects of groups the user is a member of' do let(:group) { create(:group) } - let!(:other_project) { create(:empty_project, group: group) } + let!(:other_project) { create(:project, group: group) } before do group.add_owner(user) @@ -136,7 +136,7 @@ describe Users::RefreshAuthorizedProjectsService do context 'projects of subgroups of groups the user is a member of', :nested_groups do let(:group) { create(:group) } let(:nested_group) { create(:group, parent: group) } - let!(:other_project) { create(:empty_project, group: nested_group) } + let!(:other_project) { create(:project, group: nested_group) } before do group.add_master(user) @@ -149,7 +149,7 @@ describe Users::RefreshAuthorizedProjectsService do context 'projects shared with groups the user is a member of' do let(:group) { create(:group) } - let(:other_project) { create(:empty_project) } + let(:other_project) { create(:project) } let!(:project_group_link) { create(:project_group_link, project: other_project, group: group, group_access: Gitlab::Access::GUEST) } before do @@ -164,7 +164,7 @@ describe Users::RefreshAuthorizedProjectsService do context 'projects shared with subgroups of groups the user is a member of', :nested_groups do let(:group) { create(:group) } let(:nested_group) { create(:group, parent: group) } - let(:other_project) { create(:empty_project) } + let(:other_project) { create(:project) } let!(:project_group_link) { create(:project_group_link, project: other_project, group: nested_group, group_access: Gitlab::Access::DEVELOPER) } before do diff --git a/spec/services/web_hook_service_spec.rb b/spec/services/web_hook_service_spec.rb index 0d710db812c..79d90defd78 100644 --- a/spec/services/web_hook_service_spec.rb +++ b/spec/services/web_hook_service_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe WebHookService do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:project_hook) { create(:project_hook) } let(:headers) do { diff --git a/spec/services/wiki_pages/create_service_spec.rb b/spec/services/wiki_pages/create_service_spec.rb index fa3863e9b30..b270194d9b8 100644 --- a/spec/services/wiki_pages/create_service_spec.rb +++ b/spec/services/wiki_pages/create_service_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe WikiPages::CreateService do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } let(:opts) do diff --git a/spec/services/wiki_pages/destroy_service_spec.rb b/spec/services/wiki_pages/destroy_service_spec.rb index 1668cd00ca8..2938126914b 100644 --- a/spec/services/wiki_pages/destroy_service_spec.rb +++ b/spec/services/wiki_pages/destroy_service_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe WikiPages::DestroyService do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } let(:page) { create(:wiki_page) } diff --git a/spec/services/wiki_pages/update_service_spec.rb b/spec/services/wiki_pages/update_service_spec.rb index a672c84034b..a242bf5a5cc 100644 --- a/spec/services/wiki_pages/update_service_spec.rb +++ b/spec/services/wiki_pages/update_service_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe WikiPages::UpdateService do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } let(:page) { create(:wiki_page) } diff --git a/spec/support/api/milestones_shared_examples.rb b/spec/support/api/milestones_shared_examples.rb index 480e7d5151f..bf769225012 100644 --- a/spec/support/api/milestones_shared_examples.rb +++ b/spec/support/api/milestones_shared_examples.rb @@ -239,7 +239,7 @@ shared_examples_for 'group and project milestones' do |route_definition| end describe 'confidential issues' do - let!(:public_project) { create(:empty_project, :public) } + let!(:public_project) { create(:project, :public) } let!(:context_group) { try(:group) } let!(:milestone) do context_group ? create(:milestone, group: context_group) : create(:milestone, project: public_project) diff --git a/spec/support/chat_slash_commands_shared_examples.rb b/spec/support/chat_slash_commands_shared_examples.rb index 978b0b9cc30..dc97a39f051 100644 --- a/spec/support/chat_slash_commands_shared_examples.rb +++ b/spec/support/chat_slash_commands_shared_examples.rb @@ -36,7 +36,7 @@ RSpec.shared_examples 'chat slash commands service' do end context 'with a token passed' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:params) { { token: 'token' } } before do diff --git a/spec/support/controllers/githubish_import_controller_shared_examples.rb b/spec/support/controllers/githubish_import_controller_shared_examples.rb index a8d9566b4e4..4eec3127464 100644 --- a/spec/support/controllers/githubish_import_controller_shared_examples.rb +++ b/spec/support/controllers/githubish_import_controller_shared_examples.rb @@ -56,7 +56,7 @@ shared_examples 'a GitHub-ish import controller: GET status' do end it "assigns variables" do - project = create(:empty_project, import_type: provider, creator_id: user.id) + project = create(:project, import_type: provider, creator_id: user.id) stub_client(repos: [repo, org_repo], orgs: [org], org_repos: [org_repo]) get :status @@ -69,7 +69,7 @@ shared_examples 'a GitHub-ish import controller: GET status' do end it "does not show already added project" do - project = create(:empty_project, import_type: provider, creator_id: user.id, import_source: 'asd/vim') + project = create(:project, import_type: provider, creator_id: user.id, import_source: 'asd/vim') stub_client(repos: [repo], orgs: []) get :status diff --git a/spec/support/features/issuable_slash_commands_shared_examples.rb b/spec/support/features/issuable_slash_commands_shared_examples.rb index 47a7fd0c2ea..32835e391a8 100644 --- a/spec/support/features/issuable_slash_commands_shared_examples.rb +++ b/spec/support/features/issuable_slash_commands_shared_examples.rb @@ -10,7 +10,7 @@ shared_examples 'issuable record that supports quick actions in its description when :merge_request create(:project, :public, :repository) when :issue - create(:empty_project, :public) + create(:project, :public) end end let!(:milestone) { create(:milestone, project: project, title: 'ASAP') } diff --git a/spec/support/issuables_list_metadata_shared_examples.rb b/spec/support/issuables_list_metadata_shared_examples.rb index 1004c895bb4..a60d3b0d22d 100644 --- a/spec/support/issuables_list_metadata_shared_examples.rb +++ b/spec/support/issuables_list_metadata_shared_examples.rb @@ -30,7 +30,7 @@ shared_examples 'issuables list meta-data' do |issuable_type, action = nil| end describe "when given empty collection" do - let(:project2) { create(:empty_project, :public) } + let(:project2) { create(:project, :public) } it "doesn't execute any queries with false conditions" do get_action = diff --git a/spec/support/notify_shared_examples.rb b/spec/support/notify_shared_examples.rb index 70799bce721..d6117d604f2 100644 --- a/spec/support/notify_shared_examples.rb +++ b/spec/support/notify_shared_examples.rb @@ -3,7 +3,7 @@ shared_context 'gitlab email notification' do let(:gitlab_sender) { Gitlab.config.gitlab.email_from } let(:gitlab_sender_reply_to) { Gitlab.config.gitlab.email_reply_to } let(:recipient) { create(:user, email: 'recipient@example.com') } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:new_user_address) { 'newguy@example.com' } before do diff --git a/spec/support/project_features_apply_to_issuables_shared_examples.rb b/spec/support/project_features_apply_to_issuables_shared_examples.rb index 81b51509e0b..639b0924197 100644 --- a/spec/support/project_features_apply_to_issuables_shared_examples.rb +++ b/spec/support/project_features_apply_to_issuables_shared_examples.rb @@ -5,7 +5,7 @@ shared_examples 'project features apply to issuables' do |klass| let(:user_in_group) { create(:group_member, :developer, user: create(:user), group: group ).user } let(:user_outside_group) { create(:user) } - let(:project) { create(:empty_project, :public, project_args) } + let(:project) { create(:project, :public, project_args) } def project_args feature = "#{described_class.model_name.plural}_access_level".to_sym diff --git a/spec/support/services/migrate_to_ghost_user_service_shared_examples.rb b/spec/support/services/migrate_to_ghost_user_service_shared_examples.rb index bbb63a08374..adfd256dff1 100644 --- a/spec/support/services/migrate_to_ghost_user_service_shared_examples.rb +++ b/spec/support/services/migrate_to_ghost_user_service_shared_examples.rb @@ -8,7 +8,7 @@ shared_examples "migrating a deleted user's associated records to the ghost user when MergeRequest create(:project, :repository) else - create(:empty_project) + create(:project) end end diff --git a/spec/uploaders/file_uploader_spec.rb b/spec/uploaders/file_uploader_spec.rb index c2510a10286..2492d56a5cf 100644 --- a/spec/uploaders/file_uploader_spec.rb +++ b/spec/uploaders/file_uploader_spec.rb @@ -1,11 +1,11 @@ require 'spec_helper' describe FileUploader do - let(:uploader) { described_class.new(build_stubbed(:empty_project)) } + let(:uploader) { described_class.new(build_stubbed(:project)) } describe '.absolute_path' do it 'returns the correct absolute path by building it dynamically' do - project = build_stubbed(:empty_project) + project = build_stubbed(:project) upload = double(model: project, path: 'secret/foo.jpg') dynamic_segment = project.path_with_namespace @@ -17,7 +17,7 @@ describe FileUploader do describe "#store_dir" do it "stores in the namespace path" do - project = build_stubbed(:empty_project) + project = build_stubbed(:project) uploader = described_class.new(project) expect(uploader.store_dir).to include(project.path_with_namespace) diff --git a/spec/uploaders/personal_file_uploader_spec.rb b/spec/uploaders/personal_file_uploader_spec.rb index eb55e8ebd24..e505edc75ce 100644 --- a/spec/uploaders/personal_file_uploader_spec.rb +++ b/spec/uploaders/personal_file_uploader_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe PersonalFileUploader do - let(:uploader) { described_class.new(build_stubbed(:empty_project)) } + let(:uploader) { described_class.new(build_stubbed(:project)) } let(:snippet) { create(:personal_snippet) } describe '.absolute_path' do diff --git a/spec/validators/dynamic_path_validator_spec.rb b/spec/validators/dynamic_path_validator_spec.rb index dd90a836a78..08e1c5a728a 100644 --- a/spec/validators/dynamic_path_validator_spec.rb +++ b/spec/validators/dynamic_path_validator_spec.rb @@ -28,7 +28,7 @@ describe DynamicPathValidator do describe '#path_valid_for_record?' do context 'for project' do it 'calls valid_project_path?' do - project = build(:empty_project, path: 'activity') + project = build(:project, path: 'activity') expect(described_class).to receive(:valid_project_path?).with(project.full_path).and_call_original @@ -86,7 +86,7 @@ describe DynamicPathValidator do end it 'updating to an invalid path is not allowed' do - project = create(:empty_project) + project = create(:project) project.path = 'update' validator.validate_each(project, :path, 'update') diff --git a/spec/views/admin/dashboard/index.html.haml_spec.rb b/spec/views/admin/dashboard/index.html.haml_spec.rb index 68d2d72876e..df742bf6848 100644 --- a/spec/views/admin/dashboard/index.html.haml_spec.rb +++ b/spec/views/admin/dashboard/index.html.haml_spec.rb @@ -4,7 +4,7 @@ describe 'admin/dashboard/index.html.haml' do include Devise::Test::ControllerHelpers before do - assign(:projects, create_list(:empty_project, 1)) + assign(:projects, create_list(:project, 1)) assign(:users, create_list(:user, 1)) assign(:groups, create_list(:group, 1)) diff --git a/spec/views/ci/status/_badge.html.haml_spec.rb b/spec/views/ci/status/_badge.html.haml_spec.rb index de0b59f83f8..49f57969239 100644 --- a/spec/views/ci/status/_badge.html.haml_spec.rb +++ b/spec/views/ci/status/_badge.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe 'ci/status/_badge' do let(:user) { create(:user) } - let(:project) { create(:empty_project, :private) } + let(:project) { create(:project, :private) } let(:pipeline) { create(:ci_pipeline, project: project) } context 'when rendering status for build' do diff --git a/spec/views/projects/_home_panel.html.haml_spec.rb b/spec/views/projects/_home_panel.html.haml_spec.rb index f8c6cb6b5c6..62af946dcab 100644 --- a/spec/views/projects/_home_panel.html.haml_spec.rb +++ b/spec/views/projects/_home_panel.html.haml_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe 'projects/_home_panel' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:notification_settings) do user&.notification_settings_for(project) diff --git a/spec/views/projects/blob/_viewer.html.haml_spec.rb b/spec/views/projects/blob/_viewer.html.haml_spec.rb index af833168bd9..aedbaa66d34 100644 --- a/spec/views/projects/blob/_viewer.html.haml_spec.rb +++ b/spec/views/projects/blob/_viewer.html.haml_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe 'projects/blob/_viewer.html.haml' do include FakeBlobHelpers - let(:project) { build(:empty_project) } + let(:project) { build(:project) } let(:viewer_class) do Class.new(BlobViewer::Base) do diff --git a/spec/views/projects/edit.html.haml_spec.rb b/spec/views/projects/edit.html.haml_spec.rb index d2575702ecc..94899e26292 100644 --- a/spec/views/projects/edit.html.haml_spec.rb +++ b/spec/views/projects/edit.html.haml_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe 'projects/edit' do include Devise::Test::ControllerHelpers - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:admin) } before do diff --git a/spec/views/projects/notes/_more_actions_dropdown.html.haml_spec.rb b/spec/views/projects/notes/_more_actions_dropdown.html.haml_spec.rb index 37ce7121ccb..aea20d826d0 100644 --- a/spec/views/projects/notes/_more_actions_dropdown.html.haml_spec.rb +++ b/spec/views/projects/notes/_more_actions_dropdown.html.haml_spec.rb @@ -4,7 +4,7 @@ describe 'projects/notes/_more_actions_dropdown' do let(:author_user) { create(:user) } let(:not_author_user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:issue) { create(:issue, project: project) } let!(:note) { create(:note_on_issue, author: author_user, noteable: issue, project: project) } diff --git a/spec/views/projects/registry/repositories/index.html.haml_spec.rb b/spec/views/projects/registry/repositories/index.html.haml_spec.rb index f13b657d474..cf0aa44a4a2 100644 --- a/spec/views/projects/registry/repositories/index.html.haml_spec.rb +++ b/spec/views/projects/registry/repositories/index.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe 'projects/registry/repositories/index' do let(:group) { create(:group, path: 'group') } - let(:project) { create(:empty_project, group: group, path: 'test') } + let(:project) { create(:project, group: group, path: 'test') } let(:repository) do create(:container_repository, project: project, name: 'image') diff --git a/spec/views/projects/tags/index.html.haml_spec.rb b/spec/views/projects/tags/index.html.haml_spec.rb index f65cd9f398f..cb97d17988c 100644 --- a/spec/views/projects/tags/index.html.haml_spec.rb +++ b/spec/views/projects/tags/index.html.haml_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe 'projects/tags/index' do - let(:project) { create(:project) } + let(:project) { create(:project, :repository) } before do assign(:project, project) diff --git a/spec/views/shared/projects/_project.html.haml_spec.rb b/spec/views/shared/projects/_project.html.haml_spec.rb index 43334c2c236..b500016016a 100644 --- a/spec/views/shared/projects/_project.html.haml_spec.rb +++ b/spec/views/shared/projects/_project.html.haml_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe 'shared/projects/_project.html.haml' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } it 'should render creator avatar if project has a creator' do render 'shared/projects/project', use_creator_avatar: true, project: project diff --git a/spec/workers/authorized_projects_worker_spec.rb b/spec/workers/authorized_projects_worker_spec.rb index bd5cc651c2b..03b9b99e263 100644 --- a/spec/workers/authorized_projects_worker_spec.rb +++ b/spec/workers/authorized_projects_worker_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe AuthorizedProjectsWorker do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } describe '.bulk_perform_and_wait' do it 'schedules the ids and waits for the jobs to complete' do diff --git a/spec/workers/create_gpg_signature_worker_spec.rb b/spec/workers/create_gpg_signature_worker_spec.rb index 62ec011a3fe..c6a17d77d73 100644 --- a/spec/workers/create_gpg_signature_worker_spec.rb +++ b/spec/workers/create_gpg_signature_worker_spec.rb @@ -4,7 +4,7 @@ describe CreateGpgSignatureWorker do context 'when GpgKey is found' do it 'calls Commit#signature' do commit_sha = '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33' - project = create :empty_project + project = create :project commit = instance_double(Commit) allow(Project).to receive(:find_by).with(id: project.id).and_return(project) @@ -18,7 +18,7 @@ describe CreateGpgSignatureWorker do context 'when Commit is not found' do let(:nonexisting_commit_sha) { 'bogus' } - let(:project) { create :empty_project } + let(:project) { create :project } it 'does not raise errors' do expect { described_class.new.perform(nonexisting_commit_sha, project.id) }.not_to raise_error diff --git a/spec/workers/expire_pipeline_cache_worker_spec.rb b/spec/workers/expire_pipeline_cache_worker_spec.rb index e4f78999489..54c9a69d329 100644 --- a/spec/workers/expire_pipeline_cache_worker_spec.rb +++ b/spec/workers/expire_pipeline_cache_worker_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe ExpirePipelineCacheWorker do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:pipeline) { create(:ci_pipeline, project: project) } subject { described_class.new } diff --git a/spec/workers/group_destroy_worker_spec.rb b/spec/workers/group_destroy_worker_spec.rb index c78efc67076..a170c84ab12 100644 --- a/spec/workers/group_destroy_worker_spec.rb +++ b/spec/workers/group_destroy_worker_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe GroupDestroyWorker do let(:group) { create(:group) } let(:user) { create(:admin) } - let!(:project) { create(:empty_project, namespace: group) } + let!(:project) { create(:project, namespace: group) } subject { described_class.new } diff --git a/spec/workers/namespaceless_project_destroy_worker_spec.rb b/spec/workers/namespaceless_project_destroy_worker_spec.rb index f9e23d648ec..f2706254284 100644 --- a/spec/workers/namespaceless_project_destroy_worker_spec.rb +++ b/spec/workers/namespaceless_project_destroy_worker_spec.rb @@ -12,7 +12,7 @@ describe NamespacelessProjectDestroyWorker do describe '#perform' do context 'project has namespace' do it 'does not do anything' do - project = create(:empty_project) + project = create(:project) subject.perform(project.id) @@ -22,7 +22,7 @@ describe NamespacelessProjectDestroyWorker do context 'project has no namespace' do let!(:project) do - project = build(:empty_project, namespace_id: nil) + project = build(:project, namespace_id: nil) project.save(validate: false) project end @@ -54,7 +54,7 @@ describe NamespacelessProjectDestroyWorker do end context 'project forked from another' do - let!(:parent_project) { create(:empty_project) } + let!(:parent_project) { create(:project) } before do create(:forked_project_link, forked_to_project: project, forked_from_project: parent_project) diff --git a/spec/workers/remove_unreferenced_lfs_objects_worker_spec.rb b/spec/workers/remove_unreferenced_lfs_objects_worker_spec.rb index 1c183ce54f4..57f83c1dbe9 100644 --- a/spec/workers/remove_unreferenced_lfs_objects_worker_spec.rb +++ b/spec/workers/remove_unreferenced_lfs_objects_worker_spec.rb @@ -6,8 +6,8 @@ describe RemoveUnreferencedLfsObjectsWorker do describe '#perform' do let!(:unreferenced_lfs_object1) { create(:lfs_object, oid: '1') } let!(:unreferenced_lfs_object2) { create(:lfs_object, oid: '2') } - let!(:project1) { create(:empty_project, lfs_enabled: true) } - let!(:project2) { create(:empty_project, lfs_enabled: true) } + let!(:project1) { create(:project, lfs_enabled: true) } + let!(:project2) { create(:project, lfs_enabled: true) } let!(:referenced_lfs_object1) { create(:lfs_object, oid: '3') } let!(:referenced_lfs_object2) { create(:lfs_object, oid: '4') } let!(:lfs_objects_project1_1) do diff --git a/spec/workers/repository_check/batch_worker_spec.rb b/spec/workers/repository_check/batch_worker_spec.rb index bcd97a4f6ef..850b8cd8f5c 100644 --- a/spec/workers/repository_check/batch_worker_spec.rb +++ b/spec/workers/repository_check/batch_worker_spec.rb @@ -4,7 +4,7 @@ describe RepositoryCheck::BatchWorker do subject { described_class.new } it 'prefers projects that have never been checked' do - projects = create_list(:empty_project, 3, created_at: 1.week.ago) + projects = create_list(:project, 3, created_at: 1.week.ago) projects[0].update_column(:last_repository_check_at, 4.months.ago) projects[2].update_column(:last_repository_check_at, 3.months.ago) @@ -12,7 +12,7 @@ describe RepositoryCheck::BatchWorker do end it 'sorts projects by last_repository_check_at' do - projects = create_list(:empty_project, 3, created_at: 1.week.ago) + projects = create_list(:project, 3, created_at: 1.week.ago) projects[0].update_column(:last_repository_check_at, 2.months.ago) projects[1].update_column(:last_repository_check_at, 4.months.ago) projects[2].update_column(:last_repository_check_at, 3.months.ago) @@ -21,7 +21,7 @@ describe RepositoryCheck::BatchWorker do end it 'excludes projects that were checked recently' do - projects = create_list(:empty_project, 3, created_at: 1.week.ago) + projects = create_list(:project, 3, created_at: 1.week.ago) projects[0].update_column(:last_repository_check_at, 2.days.ago) projects[1].update_column(:last_repository_check_at, 2.months.ago) projects[2].update_column(:last_repository_check_at, 3.days.ago) @@ -30,7 +30,7 @@ describe RepositoryCheck::BatchWorker do end it 'does nothing when repository checks are disabled' do - create(:empty_project, created_at: 1.week.ago) + create(:project, created_at: 1.week.ago) current_settings = double('settings', repository_checks_enabled: false) expect(subject).to receive(:current_settings) { current_settings } @@ -38,7 +38,7 @@ describe RepositoryCheck::BatchWorker do end it 'skips projects created less than 24 hours ago' do - project = create(:empty_project) + project = create(:project) project.update_column(:created_at, 23.hours.ago) expect(subject.perform).to eq([]) diff --git a/spec/workers/repository_check/clear_worker_spec.rb b/spec/workers/repository_check/clear_worker_spec.rb index 3b1a64c5057..1c49415d46c 100644 --- a/spec/workers/repository_check/clear_worker_spec.rb +++ b/spec/workers/repository_check/clear_worker_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe RepositoryCheck::ClearWorker do it 'clears repository check columns' do - project = create(:empty_project) + project = create(:project) project.update_columns( last_repository_check_failed: true, last_repository_check_at: Time.now diff --git a/spec/workers/repository_import_worker_spec.rb b/spec/workers/repository_import_worker_spec.rb index 6b30dabc80e..ca904e512ac 100644 --- a/spec/workers/repository_import_worker_spec.rb +++ b/spec/workers/repository_import_worker_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe RepositoryImportWorker do - let(:project) { create(:empty_project, :import_scheduled) } + let(:project) { create(:project, :import_scheduled) } subject { described_class.new } diff --git a/spec/workers/stuck_import_jobs_worker_spec.rb b/spec/workers/stuck_import_jobs_worker_spec.rb index 466277a5e5e..2f5b685a332 100644 --- a/spec/workers/stuck_import_jobs_worker_spec.rb +++ b/spec/workers/stuck_import_jobs_worker_spec.rb @@ -9,7 +9,7 @@ describe StuckImportJobsWorker do end describe 'long running import' do - let(:project) { create(:empty_project, import_jid: '123', import_status: 'started') } + let(:project) { create(:project, import_jid: '123', import_status: 'started') } before do allow(Gitlab::SidekiqStatus).to receive(:completed_jids).and_return(['123']) @@ -21,7 +21,7 @@ describe StuckImportJobsWorker do end describe 'running import' do - let(:project) { create(:empty_project, import_jid: '123', import_status: 'started') } + let(:project) { create(:project, import_jid: '123', import_status: 'started') } before do allow(Gitlab::SidekiqStatus).to receive(:completed_jids).and_return([]) |