Commit 17f36d4b authored by Robert Speicher's avatar Robert Speicher

Change all `:empty_project` to `:project`

parent 037a62f3
...@@ -66,7 +66,7 @@ class Spinach::Features::ExploreGroups < Spinach::FeatureSteps ...@@ -66,7 +66,7 @@ class Spinach::Features::ExploreGroups < Spinach::FeatureSteps
def group_has_project(groupname, projectname, visibility_level) def group_has_project(groupname, projectname, visibility_level)
group = Group.find_by(name: groupname) || create(:group, name: groupname) group = Group.find_by(name: groupname) || create(:group, name: groupname)
project = create(:empty_project, project = create(:project,
namespace: group, namespace: group,
name: projectname, name: projectname,
path: "#{groupname}-#{projectname}", path: "#{groupname}-#{projectname}",
......
...@@ -100,7 +100,7 @@ class Spinach::Features::GroupMilestones < Spinach::FeatureSteps ...@@ -100,7 +100,7 @@ class Spinach::Features::GroupMilestones < Spinach::FeatureSteps
group = owned_group group = owned_group
%w(gitlabhq gitlab-ci cookbook-gitlab).each do |path| %w(gitlabhq gitlab-ci cookbook-gitlab).each do |path|
project = create(:empty_project, path: path, group: group) project = create(:project, path: path, group: group)
milestone = create :milestone, title: "Version 7.2", project: project milestone = create :milestone, title: "Version 7.2", project: project
create(:label, project: project, title: 'bug') create(:label, project: project, title: 'bug')
......
...@@ -15,7 +15,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps ...@@ -15,7 +15,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
step 'Group "Owned" has a public project "Public-project"' do step 'Group "Owned" has a public project "Public-project"' do
group = owned_group group = owned_group
@project = create :empty_project, :public, @project = create :project, :public,
group: group, group: group,
name: "Public-project" name: "Public-project"
end end
...@@ -132,7 +132,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps ...@@ -132,7 +132,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
step 'Group "Owned" has archived project' do step 'Group "Owned" has archived project' do
group = Group.find_by(name: 'Owned') group = Group.find_by(name: 'Owned')
@archived_project = create(:empty_project, :archived, namespace: group, path: "archived-project") @archived_project = create(:project, :archived, namespace: group, path: "archived-project")
end end
step 'I should see "archived" label' do step 'I should see "archived" label' do
......
...@@ -47,11 +47,11 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps ...@@ -47,11 +47,11 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps
end end
step 'other projects have deploy keys' do step 'other projects have deploy keys' do
@second_project = create(:empty_project, namespace: create(:group)) @second_project = create(:project, namespace: create(:group))
@second_project.team << [current_user, :master] @second_project.team << [current_user, :master]
create(:deploy_keys_project, project: @second_project) create(:deploy_keys_project, project: @second_project)
@third_project = create(:empty_project, namespace: create(:group)) @third_project = create(:project, namespace: create(:group))
@third_project.team << [current_user, :master] @third_project.team << [current_user, :master]
create(:deploy_keys_project, project: @third_project, deploy_key: @second_project.deploy_keys.first) create(:deploy_keys_project, project: @third_project, deploy_key: @second_project.deploy_keys.first)
end end
......
...@@ -4,11 +4,11 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps ...@@ -4,11 +4,11 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps
include SharedProject include SharedProject
step 'public project "Community"' do step 'public project "Community"' do
create(:empty_project, :public, name: 'Community') create(:project, :public, name: 'Community')
end end
step 'private project "Enterprise"' do step 'private project "Enterprise"' do
create(:empty_project, :private, name: 'Enterprise') create(:project, :private, name: 'Enterprise')
end end
step 'I visit project "Community" page' do step 'I visit project "Community" page' do
......
...@@ -34,7 +34,7 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps ...@@ -34,7 +34,7 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps
end end
step 'I own project "Website"' do step 'I own project "Website"' do
@project = create(:empty_project, name: "Website", namespace: @user.namespace) @project = create(:project, name: "Website", namespace: @user.namespace)
@project.team << [@user, :master] @project.team << [@user, :master]
end end
...@@ -68,7 +68,7 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps ...@@ -68,7 +68,7 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps
step 'I share project with group "OpenSource"' do step 'I share project with group "OpenSource"' do
project = Project.find_by(name: 'Shop') project = Project.find_by(name: 'Shop')
os_group = create(:group, name: 'OpenSource') os_group = create(:group, name: 'OpenSource')
create(:empty_project, group: os_group) create(:project, group: os_group)
@os_user1 = create(:user) @os_user1 = create(:user)
@os_user2 = create(:user) @os_user2 = create(:user)
os_group.add_owner(@os_user1) os_group.add_owner(@os_user1)
......
...@@ -9,7 +9,7 @@ module SharedProject ...@@ -9,7 +9,7 @@ module SharedProject
step "I own a project in some group namespace" do step "I own a project in some group namespace" do
@group = create(:group, name: 'some group') @group = create(:group, name: 'some group')
@project = create(:empty_project, namespace: @group) @project = create(:project, namespace: @group)
@project.team << [@user, :master] @project.team << [@user, :master]
end end
...@@ -54,7 +54,7 @@ module SharedProject ...@@ -54,7 +54,7 @@ module SharedProject
# Create an empty project without caring about the name # Create an empty project without caring about the name
step 'I own an empty project' do step 'I own an empty project' do
@project = create(:empty_project, @project = create(:project,
name: 'Empty Project', namespace: @user.namespace) name: 'Empty Project', namespace: @user.namespace)
@project.team << [@user, :master] @project.team << [@user, :master]
end end
...@@ -276,7 +276,7 @@ module SharedProject ...@@ -276,7 +276,7 @@ module SharedProject
def user_owns_project(user_name:, project_name:, visibility: :private) def user_owns_project(user_name:, project_name:, visibility: :private)
user = user_exists(user_name, username: user_name.gsub(/\s/, '').underscore) user = user_exists(user_name, username: user_name.gsub(/\s/, '').underscore)
project = Project.find_by(name: project_name) project = Project.find_by(name: project_name)
project ||= create(:empty_project, visibility, name: project_name, namespace: user.namespace) project ||= create(:project, visibility, name: project_name, namespace: user.namespace)
project.team << [user, :master] project.team << [user, :master]
end end
end end
...@@ -55,6 +55,6 @@ class Spinach::Features::User < Spinach::FeatureSteps ...@@ -55,6 +55,6 @@ class Spinach::Features::User < Spinach::FeatureSteps
end end
def contributed_project def contributed_project
@contributed_project ||= create(:empty_project, :public) @contributed_project ||= create(:project, :public)
end end
end end
...@@ -4,7 +4,7 @@ describe Admin::ApplicationSettingsController do ...@@ -4,7 +4,7 @@ describe Admin::ApplicationSettingsController do
include StubENV include StubENV
let(:group) { create(:group) } let(:group) { create(:group) }
let(:project) { create(:empty_project, namespace: group) } let(:project) { create(:project, namespace: group) }
let(:admin) { create(:admin) } let(:admin) { create(:admin) }
let(:user) { create(:user)} let(:user) { create(:user)}
......
...@@ -29,8 +29,8 @@ describe Admin::DashboardController do ...@@ -29,8 +29,8 @@ describe Admin::DashboardController do
it 'does not retrieve projects that are pending deletion' do it 'does not retrieve projects that are pending deletion' do
sign_in(create(:admin)) sign_in(create(:admin))
project = create(:empty_project) project = create(:project)
pending_delete_project = create(:empty_project, pending_delete: true) pending_delete_project = create(:project, pending_delete: true)
get :index get :index
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
describe Admin::GroupsController do describe Admin::GroupsController do
let(:group) { create(:group) } let(:group) { create(:group) }
let(:project) { create(:empty_project, namespace: group) } let(:project) { create(:project, namespace: group) }
let(:admin) { create(:admin) } let(:admin) { create(:admin) }
before do before do
......
require 'spec_helper' require 'spec_helper'
describe Admin::ProjectsController do describe Admin::ProjectsController do
let!(:project) { create(:empty_project, :public) } let!(:project) { create(:project, :public) }
before do before do
sign_in(create(:admin)) sign_in(create(:admin))
......
...@@ -8,7 +8,7 @@ describe Admin::ServicesController do ...@@ -8,7 +8,7 @@ describe Admin::ServicesController do
end end
describe 'GET #edit' do describe 'GET #edit' do
let!(:project) { create(:empty_project) } let!(:project) { create(:project) }
Service.available_services_names.each do |service_name| Service.available_services_names.each do |service_name|
context "#{service_name}" do context "#{service_name}" do
...@@ -27,7 +27,7 @@ describe Admin::ServicesController do ...@@ -27,7 +27,7 @@ describe Admin::ServicesController do
end end
describe "#update" do describe "#update" do
let(:project) { create(:empty_project) } let(:project) { create(:project) }
let!(:service) do let!(:service) do
RedmineService.create( RedmineService.create(
project: project, project: project,
......
...@@ -9,7 +9,7 @@ describe Admin::UsersController do ...@@ -9,7 +9,7 @@ describe Admin::UsersController do
end end
describe 'DELETE #user with projects' do 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) } let!(:issue) { create(:issue, author: user) }
before do before do
......
require 'spec_helper' require 'spec_helper'
describe AutocompleteController do describe AutocompleteController do
let!(:project) { create(:empty_project) } let!(:project) { create(:project) }
let!(:user) { create(:user) } let!(:user) { create(:user) }
context 'GET users' do context 'GET users' do
...@@ -105,7 +105,7 @@ describe AutocompleteController do ...@@ -105,7 +105,7 @@ describe AutocompleteController do
end end
context 'non-member login for public project' do context 'non-member login for public project' do
let!(:project) { create(:empty_project, :public) } let!(:project) { create(:project, :public) }
before do before do
sign_in(non_member) sign_in(non_member)
...@@ -167,7 +167,7 @@ describe AutocompleteController do ...@@ -167,7 +167,7 @@ describe AutocompleteController do
end end
context 'unauthenticated user' do context 'unauthenticated user' do
let(:public_project) { create(:empty_project, :public) } let(:public_project) { create(:project, :public) }
let(:body) { JSON.parse(response.body) } let(:body) { JSON.parse(response.body) }
describe 'GET #users with public project' do describe 'GET #users with public project' do
...@@ -271,8 +271,8 @@ describe AutocompleteController do ...@@ -271,8 +271,8 @@ describe AutocompleteController do
end end
context 'GET projects' do context 'GET projects' do
let(:authorized_project) { create(:empty_project) } let(:authorized_project) { create(:project) }
let(:authorized_search_project) { create(:empty_project, name: 'rugged') } let(:authorized_search_project) { create(:project, name: 'rugged') }
before do before do
sign_in(user) sign_in(user)
...@@ -329,8 +329,8 @@ describe AutocompleteController do ...@@ -329,8 +329,8 @@ describe AutocompleteController do
context 'authorized projects apply limit' do context 'authorized projects apply limit' do
before do before do
authorized_project2 = create(:empty_project) authorized_project2 = create(:project)
authorized_project3 = create(:empty_project) authorized_project3 = create(:project)
authorized_project.add_master(user) authorized_project.add_master(user)
authorized_project2.add_master(user) authorized_project2.add_master(user)
...@@ -355,8 +355,8 @@ describe AutocompleteController do ...@@ -355,8 +355,8 @@ describe AutocompleteController do
context 'authorized projects with offset' do context 'authorized projects with offset' do
before do before do
authorized_project2 = create(:empty_project) authorized_project2 = create(:project)
authorized_project3 = create(:empty_project) authorized_project3 = create(:project)
authorized_project.add_master(user) authorized_project.add_master(user)
authorized_project2.add_master(user) authorized_project2.add_master(user)
......
require 'spec_helper' require 'spec_helper'
describe Dashboard::LabelsController do describe Dashboard::LabelsController do
let(:project) { create(:empty_project) } let(:project) { create(:project) }
let(:user) { create(:user) } let(:user) { create(:user) }
let!(:label) { create(:label, project: project) } let!(:label) { create(:label, project: project) }
...@@ -11,7 +11,7 @@ describe Dashboard::LabelsController do ...@@ -11,7 +11,7 @@ describe Dashboard::LabelsController do
end end
describe "#index" do 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 it 'returns global labels for projects the user has a relationship with' do
get :index, format: :json get :index, format: :json
......
require 'spec_helper' require 'spec_helper'
describe Dashboard::MilestonesController do describe Dashboard::MilestonesController do
let(:project) { create(:empty_project) } let(:project) { create(:project) }
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project_milestone) { create(:milestone, project: project) } let(:project_milestone) { create(:milestone, project: project) }
let(:milestone) do let(:milestone) do
......
...@@ -3,7 +3,7 @@ require 'spec_helper' ...@@ -3,7 +3,7 @@ require 'spec_helper'
describe Dashboard::TodosController do describe Dashboard::TodosController do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:author) { create(:user) } let(:author) { create(:user) }
let(:project) { create(:empty_project) } let(:project) { create(:project) }
let(:todo_service) { TodoService.new } let(:todo_service) { TodoService.new }
before do before do
...@@ -14,7 +14,7 @@ describe Dashboard::TodosController do ...@@ -14,7 +14,7 @@ describe Dashboard::TodosController do
describe 'GET #index' do describe 'GET #index' do
context 'project authorization' do context 'project authorization' do
it 'renders 404 when user does not have read access on given project' 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 get :index, project_id: unauthorized_project.id
...@@ -34,7 +34,7 @@ describe Dashboard::TodosController do ...@@ -34,7 +34,7 @@ describe Dashboard::TodosController do
end end
it 'renders 200 when user has access on given project' do 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 get :index, project_id: authorized_project.id
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
describe DashboardController do describe DashboardController do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:empty_project) } let(:project) { create(:project) }
before do before do
project.team << [user, :master] project.team << [user, :master]
......
...@@ -3,8 +3,8 @@ require 'spec_helper' ...@@ -3,8 +3,8 @@ require 'spec_helper'
describe Explore::ProjectsController do describe Explore::ProjectsController do
describe 'GET #trending' do describe 'GET #trending' do
context 'sorting by update date' do context 'sorting by update date' do
let(:project1) { create(:empty_project, :public, updated_at: 3.days.ago) } let(:project1) { create(:project, :public, updated_at: 3.days.ago) }
let(:project2) { create(:empty_project, :public, updated_at: 1.day.ago) } let(:project2) { create(:project, :public, updated_at: 1.day.ago) }
before do before do
create(:trending_project, project: project1) create(:trending_project, project: project1)
......
...@@ -2,8 +2,8 @@ require 'spec_helper' ...@@ -2,8 +2,8 @@ require 'spec_helper'
describe Groups::MilestonesController do describe Groups::MilestonesController do
let(:group) { create(:group) } let(:group) { create(:group) }
let!(:project) { create(:empty_project, group: group) } let!(:project) { create(:project, group: group) }
let!(:project2) { create(:empty_project, group: group) } let!(:project2) { create(:project, group: group) }
let(:user) { create(:user) } let(:user) { create(:user) }
let(:title) { '肯定不是中文的问题' } let(:title) { '肯定不是中文的问题' }
let(:milestone) do let(:milestone) do
......
...@@ -3,7 +3,7 @@ require 'rails_helper' ...@@ -3,7 +3,7 @@ require 'rails_helper'
describe GroupsController do describe GroupsController do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:group) { create(:group, :public) } 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) } let!(:group_member) { create(:group_member, group: group, user: user) }
describe 'GET #index' do describe 'GET #index' do
......
...@@ -52,7 +52,7 @@ describe Import::BitbucketController do ...@@ -52,7 +52,7 @@ describe Import::BitbucketController do
end end
it "assigns variables" do 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]) allow_any_instance_of(Bitbucket::Client).to receive(:repos).and_return([@repo])
get :status get :status
...@@ -63,7 +63,7 @@ describe Import::BitbucketController do ...@@ -63,7 +63,7 @@ describe Import::BitbucketController do
end end
it "does not show already added project" do 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]) allow_any_instance_of(Bitbucket::Client).to receive(:repos).and_return([@repo])
get :status get :status
......
...@@ -16,7 +16,7 @@ describe Import::FogbugzController do ...@@ -16,7 +16,7 @@ describe Import::FogbugzController do
end end
it 'assigns variables' do 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]) stub_client(repos: [@repo])
get :status get :status
...@@ -26,7 +26,7 @@ describe Import::FogbugzController do ...@@ -26,7 +26,7 @@ describe Import::FogbugzController do
end end
it 'does not show already added project' do 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]) stub_client(repos: [@repo])
get :status get :status
......
...@@ -36,7 +36,7 @@ describe Import::GitlabController do ...@@ -36,7 +36,7 @@ describe Import::GitlabController do
end end
it "assigns variables" do 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]) stub_client(projects: [@repo])
get :status get :status
...@@ -46,7 +46,7 @@ describe Import::GitlabController do ...@@ -46,7 +46,7 @@ describe Import::GitlabController do
end end
it "does not show already added project" do 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]) stub_client(projects: [@repo])
get :status get :status
......
...@@ -27,7 +27,7 @@ describe Import::GoogleCodeController do ...@@ -27,7 +27,7 @@ describe Import::GoogleCodeController do
end end
it "assigns variables" do 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: []) stub_client(repos: [@repo], incompatible_repos: [])
get :status get :status
...@@ -38,7 +38,7 @@ describe Import::GoogleCodeController do ...@@ -38,7 +38,7 @@ describe Import::GoogleCodeController do
end end
it "does not show already added project" do 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: []) stub_client(repos: [@repo], incompatible_repos: [])
get :status get :status
......
require 'spec_helper' require 'spec_helper'
describe NotificationSettingsController do describe NotificationSettingsController do
let(:project) { create(:empty_project) } let(:project) { create(:project) }
let(:group) { create(:group, :internal) } let(:group) { create(:group, :internal) }
let(:user) { create(:user) } let(:user) { create(:user) }
...@@ -99,7 +99,7 @@ describe NotificationSettingsController do ...@@ -99,7 +99,7 @@ describe NotificationSettingsController do
end end
context 'not authorized' do context 'not authorized' do
let(:private_project) { create(:empty_project, :private) } let(:private_project) { create(:project, :private) }
before do before do
sign_in(user) sign_in(user)
......
require 'spec_helper' require 'spec_helper'
describe Projects::AvatarsController do 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) } let(:user) { create(:user) }
before do before do
......
...@@ -193,7 +193,7 @@ describe Projects::BlobController do ...@@ -193,7 +193,7 @@ describe Projects::BlobController do
context "when user doesn't have access" do context "when user doesn't have access" do
before do before do
other_project = create(:empty_project) other_project = create(:project, :repository)
merge_request.update!(source_project: other_project, target_project: other_project) merge_request.update!(source_project: other_project, target_project: other_project)
end end
......
require 'spec_helper' require 'spec_helper'
describe Projects::Boards::IssuesController do describe Projects::Boards::IssuesController do
let(:project) { create(:empty_project) } let(:project) { create(:project) }
let(:board) { create(:board, project: project) } let(:board) { create(:board, project: project) }
let(:user) { create(:user) } let(:user) { create(:user) }
let(:guest) { create(:user) } let(:guest) { create(:user) }
......
require 'spec_helper' require 'spec_helper'
describe Projects::Boards::ListsController do describe Projects::Boards::ListsController do
let(:project) { create(:empty_project) } let(:project) { create(:project) }
let(:board) { create(:board, project: project) } let(:board) { create(:board, project: project) }
let(:user) { create(:user) } let(:user) { create(:user) }
let(:guest) { create(:user) } let(:guest) { create(:user) }
......
require 'spec_helper' require 'spec_helper'
describe Projects::BoardsController do describe Projects::BoardsController do
let(:project) { create(:empty_project) } let(:project) { create(:project) }
let(:user) { create(:user) } let(:user) { create(:user) }
before do before do
......
...@@ -96,7 +96,7 @@ describe Projects::BranchesController do ...@@ -96,7 +96,7 @@ describe Projects::BranchesController do
end end
context 'repository-less project' do context 'repository-less project' do
let(:project) { create :empty_project } let(:project) { create :project }
it 'redirects to newly created branch' do it 'redirects to newly created branch' do
result = { status: :success, branch: double(name: branch) } result = { status: :success, branch: double(name: branch) }
......
...@@ -24,8 +24,8 @@ describe Projects::DeployKeysController do ...@@ -24,8 +24,8 @@ describe Projects::DeployKeysController do
end end
context 'when json requested' do context 'when json requested' do
let(:project2) { create(:empty_project, :internal)} let(:project2) { create(:project, :internal)}
let(:project_private) { create(:empty_project, :private)} let(:project_private) { create(:project, :private)}
let(:deploy_key_internal) do let(:deploy_key_internal) do
create(:deploy_key, key: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCdMHEHyhRjbhEZVddFn6lTWdgEy5Q6Bz4nwGB76xWZI5YT/1WJOMEW+sL5zYd31kk7sd3FJ5L9ft8zWMWrr/iWXQikC2cqZK24H1xy+ZUmrRuJD4qGAaIVoyyzBL+avL+lF8J5lg6YSw8gwJY/lX64/vnJHUlWw2n5BF8IFOWhiw== dummy@gitlab.com') create(:deploy_key, key: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCdMHEHyhRjbhEZVddFn6lTWdgEy5Q6Bz4nwGB76xWZI5YT/1WJOMEW+sL5zYd31kk7sd3FJ5L9ft8zWMWrr/iWXQikC2cqZK24H1xy+ZUmrRuJD4qGAaIVoyyzBL+avL+lF8J5lg6YSw8gwJY/lX64/vnJHUlWw2n5BF8IFOWhiw== dummy@gitlab.com')
......
...@@ -4,7 +4,7 @@ describe Projects::DeploymentsController do ...@@ -4,7 +4,7 @@ describe Projects::DeploymentsController do
include ApiHelpers include ApiHelpers
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:empty_project) } let(:project) { create(:project) }
let(:environment) { create(:environment, name: 'production', project: project) } let(:environment) { create(:environment, name: 'production', project: project) }
before do before do
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
describe Projects::EnvironmentsController do describe Projects::EnvironmentsController do
set(:user) { create(:user) } set(:user) { create(:user) }
set(:project) { create(:empty_project) } set(:project) { create(:project) }
set(:environment) do set(:environment) do
create(:environment, name: 'production', project: project) create(:environment, name: 'production', project: project)
......
...@@ -3,7 +3,7 @@ require 'spec_helper' ...@@ -3,7 +3,7 @@ require 'spec_helper'
describe Projects::GroupLinksController do describe Projects::GroupLinksController do
let(:group) { create(:group, :private) } let(:group) { create(:group, :private) }
let(:group2) { 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) } let(:user) { create(:user) }
before do before do
......
require 'spec_helper' require 'spec_helper'
describe Projects::HooksController do describe Projects::HooksController do
let(:project) { create(:empty_project) } let(:project) { create(:project) }
let(:user) { create(:user) } let(:user) { create(:user) }
before do before do
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
describe Projects::ImportsController do describe Projects::ImportsController do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:empty_project) } let(:project) { create(:project) }
before do before do
sign_in(user) sign_in(user)
......
...@@ -234,7 +234,7 @@ describe Projects::IssuesController do ...@@ -234,7 +234,7 @@ describe Projects::IssuesController do
end end
context 'when moving issue to another private project' do 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 context 'when user has access to move issue' do
before do before do
...@@ -594,7 +594,7 @@ describe Projects::IssuesController do ...@@ -594,7 +594,7 @@ describe Projects::IssuesController do
describe 'POST #create' do describe 'POST #create' do
def post_new_issue(issue_attrs = {}, additional_params = {}) def post_new_issue(issue_attrs = {}, additional_params = {})
sign_in(user) sign_in(user)
project = create(:empty_project, :public) project = create(:project, :public)
project.team << [user, :developer] project.team << [user, :developer]
post :create, { post :create, {
...@@ -817,7 +817,7 @@ describe Projects::IssuesController do ...@@ -817,7 +817,7 @@ describe Projects::IssuesController do
context "when the user is owner" do context "when the user is owner" do
let(:owner) { create(:user) } let(:owner) { create(:user) }
let(:namespace) { create(:namespace, owner: owner) } let(:namespace) { create(:namespace, owner: owner) }
let(:project) { create(:empty_project, namespace: namespace) } let(:project) { create(:project, namespace: namespace) }
before do before do
sign_in(owner) sign_in(owner)
......
...@@ -3,7 +3,7 @@ require 'spec_helper' ...@@ -3,7 +3,7 @@ require 'spec_helper'
describe Projects::JobsController do describe Projects::JobsController do
include ApiHelpers include ApiHelpers
let(:project) { create(:empty_project, :public) } let(:project) { create(:project, :public) }
let(:pipeline) { create(:ci_pipeline, project: project) } let(:pipeline) { create(:ci_pipeline, project: project) }
let(:user) { create(:user) } let(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
describe Projects::LabelsController do describe Projects::LabelsController do
let(:group) { create(:group) } let(:group) { create(:group) }
let(:project) { create(:empty_project, namespace: group) } let(:project) { create(:project, namespace: group) }
let(:user) { create(:user) } let(:user) { create(:user) }
before do before do
...@@ -73,7 +73,7 @@ describe Projects::LabelsController do ...@@ -73,7 +73,7 @@ describe Projects::LabelsController do
describe 'POST #generate' do describe 'POST #generate' do
context 'personal project' 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 it 'creates labels' do
post :generate, namespace_id: personal_project.namespace.to_param, project_id: personal_project post :generate, namespace_id: personal_project.namespace.to_param, project_id: personal_project
......
require 'spec_helper' require 'spec_helper'
describe Projects::MattermostsController do describe Projects::MattermostsController do
let!(:project) { create(:empty_project) } let!(:project) { create(:project) }
let!(:user) { create(:user) } let!(:user) { create(:user) }
before do before do
......
...@@ -145,7 +145,7 @@ describe Projects::MergeRequests::DiffsController do ...@@ -145,7 +145,7 @@ describe Projects::MergeRequests::DiffsController do
end end
context 'when the merge request belongs to a different project' do context 'when the merge request belongs to a different project' do
let(:other_project) { create(:empty_project) } let(:other_project) { create(:project) }
before do before do
other_project.team << [user, :master] other_project.team << [user, :master]
......
require 'spec_helper' require 'spec_helper'
describe Projects::MilestonesController do describe Projects::MilestonesController do
let(:project) { create(:empty_project) } let(:project) { create(:project) }
let(:user) { create(:user) } let(:user) { create(:user) }
let(:milestone) { create(:milestone, project: project) } let(:milestone) { create(:milestone, project: project) }
let(:issue) { create(:issue, project: project, milestone: milestone) } let(:issue) { create(:issue, project: project, milestone: milestone) }
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
describe Projects::NotesController do describe Projects::NotesController do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:empty_project) } let(:project) { create(:project) }
let(:issue) { create(:issue, project: project) } let(:issue) { create(:issue, project: project) }
let(:note) { create(:note, noteable: issue, project: project) } let(:note) { create(:note, noteable: issue, project: project) }
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
describe Projects::PagesController do describe Projects::PagesController do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:empty_project, :public, :access_requestable) } let(:project) { create(:project, :public, :access_requestable) }
let(:request_params) do let(:request_params) do
{ {
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
describe Projects::PagesDomainsController do describe Projects::PagesDomainsController do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:empty_project) } let(:project) { create(:project) }
let!(:pages_domain) { create(:pages_domain, project: project) } let!(:pages_domain) { create(:pages_domain, project: project) }
let(:request_params) do let(:request_params) do
......
...@@ -3,7 +3,7 @@ require 'spec_helper' ...@@ -3,7 +3,7 @@ require 'spec_helper'
describe Projects::PipelineSchedulesController do describe Projects::PipelineSchedulesController do
include AccessMatchersForController include AccessMatchersForController
set(:project) { create(:empty_project, :public) } set(:project) { create(:project, :public) }
let!(:pipeline_schedule) { create(:ci_pipeline_schedule, project: project) } let!(:pipeline_schedule) { create(:ci_pipeline_schedule, project: project) }
describe 'GET #index' do describe 'GET #index' do
......
...@@ -4,7 +4,7 @@ describe Projects::PipelinesController do ...@@ -4,7 +4,7 @@ describe Projects::PipelinesController do
include ApiHelpers include ApiHelpers
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:empty_project, :public) } let(:project) { create(:project, :public) }
let(:feature) { ProjectFeature::DISABLED } let(:feature) { ProjectFeature::DISABLED }
before do before do
......
...@@ -2,7 +2,7 @@ require('spec_helper') ...@@ -2,7 +2,7 @@ require('spec_helper')
describe Projects::ProjectMembersController do describe Projects::ProjectMembersController do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:empty_project, :public, :access_requestable) } let(:project) { create(:project, :public, :access_requestable) }
describe 'GET index' do describe 'GET index' do
it 'should have the project_members address with a 200 status code' do it 'should have the project_members address with a 200 status code' do
...@@ -158,7 +158,7 @@ describe Projects::ProjectMembersController do ...@@ -158,7 +158,7 @@ describe Projects::ProjectMembersController do
end end
context 'and is an owner' do context 'and is an owner' do
let(:project) { create(:empty_project, namespace: user.namespace) } let(:project) { create(:project, namespace: user.namespace) }
before do before do
project.team << [user, :master] project.team << [user, :master]
...@@ -261,7 +261,7 @@ describe Projects::ProjectMembersController do ...@@ -261,7 +261,7 @@ describe Projects::ProjectMembersController do
end end
describe 'POST apply_import' do describe 'POST apply_import' do
let(:another_project) { create(:empty_project, :private) } let(:another_project) { create(:project, :private) }
let(:member) { create(:user) } let(:member) { create(:user) }
before do before do
......
...@@ -2,7 +2,7 @@ require('spec_helper') ...@@ -2,7 +2,7 @@ require('spec_helper')
describe Projects::PrometheusController do describe Projects::PrometheusController do
let(:user) { create(:user) } let(:user) { create(:user) }
let!(:project) { create(:empty_project) } let!(:project) { create(:project) }
let(:prometheus_service) { double('prometheus_service') } let(:prometheus_service) { double('prometheus_service') }
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
describe Projects::Registry::RepositoriesController do describe Projects::Registry::RepositoriesController do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:empty_project, :private) } let(:project) { create(:project, :private) }
before do before do
sign_in(user) sign_in(user)
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
describe Projects::Registry::TagsController do describe Projects::Registry::TagsController do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:empty_project, :private) } let(:project) { create(:project, :private) }
before do before do
sign_in(user) sign_in(user)
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
describe Projects::RunnersController do describe Projects::RunnersController do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:empty_project) } let(:project) { create(:project) }
let(:runner) { create(:ci_runner) } let(:runner) { create(:ci_runner) }
let(:params) do let(:params) do
......
...@@ -28,7 +28,7 @@ describe Projects::ServicesController do ...@@ -28,7 +28,7 @@ describe Projects::ServicesController do
context 'success' do context 'success' do
context 'with empty project' do context 'with empty project' do
let(:project) { create(:empty_project) } let(:project) { create(:project) }
context 'with chat notification service' do context 'with chat notification service' do
let(:service) { project.create_microsoft_teams_service(webhook: 'http://webhook.com') } let(:service) { project.create_microsoft_teams_service(webhook: 'http://webhook.com') }
......
require('spec_helper') require('spec_helper')
describe Projects::Settings::CiCdController do describe Projects::Settings::CiCdController do
let(:project) { create(:empty_project, :public, :access_requestable) } let(:project) { create(:project, :public, :access_requestable) }
let(:user) { create(:user) } let(:user) { create(:user) }
before do before do
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
describe Projects::Settings::IntegrationsController do describe Projects::Settings::IntegrationsController do
let(:namespace) { create(:group, :private) } let(:namespace) { create(:group, :private) }
let(:project) { create(:empty_project, :private, namespace: namespace) } let(:project) { create(:project, :private, namespace: namespace) }
let(:user) { create(:user) } let(:user) { create(:user) }
before do before do
......
...@@ -156,7 +156,7 @@ describe Projects::SnippetsController do ...@@ -156,7 +156,7 @@ describe Projects::SnippetsController do
end end
describe 'PUT #update' do 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 } let(:snippet) { create :project_snippet, author: user, project: project, visibility_level: visibility_level }
def update_snippet(snippet_params = {}, additional_params = {}) def update_snippet(snippet_params = {}, additional_params = {})
......
...@@ -2,7 +2,7 @@ require('spec_helper') ...@@ -2,7 +2,7 @@ require('spec_helper')
describe Projects::TodosController do describe Projects::TodosController do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:empty_project) } let(:project) { create(:project) }
let(:issue) { create(:issue, project: project) } let(:issue) { create(:issue, project: project) }
let(:merge_request) { create(:merge_request, source_project: project) } let(:merge_request) { create(:merge_request, source_project: project) }
......
require('spec_helper') require('spec_helper')
describe Projects::UploadsController do describe Projects::UploadsController do
let(:project) { create(:empty_project) } let(:project) { create(:project) }
let(:user) { create(:user) } let(:user) { create(:user) }
let(:jpg) { fixture_file_upload(Rails.root + 'spec/fixtures/rails_sample.jpg', 'image/jpg') } 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') } let(:txt) { fixture_file_upload(Rails.root + 'spec/fixtures/doc_sample.txt', 'text/plain') }
......
require 'spec_helper' require 'spec_helper'
describe Projects::VariablesController do describe Projects::VariablesController do
let(:project) { create(:empty_project) } let(:project) { create(:project) }
let(:user) { create(:user) } let(:user) { create(:user) }
before do before do
......
require('spec_helper') require('spec_helper')
describe ProjectsController do describe ProjectsController do
let(:project) { create(:empty_project) } let(:project) { create(:project) }
let(:public_project) { create(:empty_project, :public) } let(:public_project) { create(:project, :public) }
let(:user) { create(:user) } let(:user) { create(:user) }
let(:jpg) { fixture_file_upload(Rails.root + 'spec/fixtures/rails_sample.jpg', 'image/jpg') } 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') } let(:txt) { fixture_file_upload(Rails.root + 'spec/fixtures/doc_sample.txt', 'text/plain') }
...@@ -34,7 +34,7 @@ describe ProjectsController do ...@@ -34,7 +34,7 @@ describe ProjectsController do
end end
context "user does not have access to project" do 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 it "does not initialize notification setting" do
get :show, namespace_id: private_project.namespace, id: private_project get :show, namespace_id: private_project.namespace, id: private_project
...@@ -199,7 +199,7 @@ describe ProjectsController do ...@@ -199,7 +199,7 @@ describe ProjectsController do
end end
context "when the url contains .atom" do 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 it 'expects an error creating the project' do
expect(public_project_with_dot_atom).not_to be_valid expect(public_project_with_dot_atom).not_to be_valid
...@@ -208,7 +208,7 @@ describe ProjectsController do ...@@ -208,7 +208,7 @@ describe ProjectsController do
context 'when the project is pending deletions' do context 'when the project is pending deletions' do
it 'renders a 404 error' do it 'renders a 404 error' do
project = create(:empty_project, pending_delete: true) project = create(:project, pending_delete: true)
sign_in(user) sign_in(user)
get :show, namespace_id: project.namespace, id: project get :show, namespace_id: project.namespace, id: project
...@@ -219,7 +219,7 @@ describe ProjectsController do ...@@ -219,7 +219,7 @@ describe ProjectsController do
context "redirection from http://someproject.git" do context "redirection from http://someproject.git" do
it 'redirects to project page (format.html)' 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 get :show, namespace_id: project.namespace, id: project, format: :git
...@@ -431,7 +431,7 @@ describe ProjectsController do ...@@ -431,7 +431,7 @@ describe ProjectsController do
end end
context 'when project not forked' do 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 it 'does nothing if project was not forked' do
delete(:remove_fork, delete(:remove_fork,
......
...@@ -8,7 +8,7 @@ describe SearchController do ...@@ -8,7 +8,7 @@ describe SearchController do
end end
it 'finds issue comments' do it 'finds issue comments' do
project = create(:empty_project, :public) project = create(:project, :public)
note = create(:note_on_issue, project: project) note = create(:note_on_issue, project: project)
get :show, project_id: project.id, scope: 'notes', search: note.note get :show, project_id: project.id, scope: 'notes', search: note.note
...@@ -23,7 +23,7 @@ describe SearchController do ...@@ -23,7 +23,7 @@ describe SearchController do
end end
it "doesn't expose comments on issues" do 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) note = create(:note_on_issue, project: project)
get :show, project_id: project.id, scope: 'notes', search: note.note get :show, project_id: project.id, scope: 'notes', search: note.note
...@@ -33,7 +33,7 @@ describe SearchController do ...@@ -33,7 +33,7 @@ describe SearchController do
end end
it "doesn't expose comments on merge_requests" do 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) note = create(:note_on_merge_request, project: project)
get :show, project_id: project.id, scope: 'notes', search: note.note get :show, project_id: project.id, scope: 'notes', search: note.note
...@@ -42,7 +42,7 @@ describe SearchController do ...@@ -42,7 +42,7 @@ describe SearchController do
end end
it "doesn't expose comments on snippets" do 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) note = create(:note_on_project_snippet, project: project)
get :show, project_id: project.id, scope: 'notes', search: note.note get :show, project_id: project.id, scope: 'notes', search: note.note
......
...@@ -2,7 +2,7 @@ require 'rails_helper' ...@@ -2,7 +2,7 @@ require 'rails_helper'
describe SentNotificationsController do describe SentNotificationsController do
let(:user) { create(:user) } 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(:sent_notification) { create(:sent_notification, project: project, noteable: issue, recipient: user) }
let(:issue) do let(:issue) do
......
...@@ -273,7 +273,7 @@ describe SnippetsController do ...@@ -273,7 +273,7 @@ describe SnippetsController do
end end
describe 'PUT #update' do 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 } let(:snippet) { create :personal_snippet, author: user, project: project, visibility_level: visibility_level }
def update_snippet(snippet_params = {}, additional_params = {}) def update_snippet(snippet_params = {}, additional_params = {})
......
...@@ -131,7 +131,7 @@ describe UploadsController do ...@@ -131,7 +131,7 @@ describe UploadsController do
describe "GET show" do describe "GET show" do
context 'Content-Disposition security measures' do context 'Content-Disposition security measures' do
let(:project) { create(:empty_project, :public) } let(:project) { create(:project, :public) }
context 'for PNG files' do context 'for PNG files' do
it 'returns Content-Disposition: inline' do it 'returns Content-Disposition: inline' do
...@@ -203,7 +203,7 @@ describe UploadsController do ...@@ -203,7 +203,7 @@ describe UploadsController do
end end
context "when viewing a project avatar" do 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 context "when the project is public" do
before do before do
......
...@@ -86,7 +86,7 @@ describe UsersController do ...@@ -86,7 +86,7 @@ describe UsersController do
end end
context 'forked project' do context 'forked project' do
let(:project) { create(:empty_project) } let(:project) { create(:project) }
let(:forked_project) { Projects::ForkService.new(project, user).execute } let(:forked_project) { Projects::ForkService.new(project, user).execute }
before do before do
...@@ -104,7 +104,7 @@ describe UsersController do ...@@ -104,7 +104,7 @@ describe UsersController do
end end
describe 'GET #calendar_activities' do describe 'GET #calendar_activities' do
let!(:project) { create(:empty_project) } let!(:project) { create(:project) }
let(:user) { create(:user) } let(:user) { create(:user) }
before do before do
......
FactoryGirl.define do FactoryGirl.define do
factory :board do factory :board do
sequence(:name) { |n| "board#{n}" } sequence(:name) { |n| "board#{n}" }
project factory: :empty_project project
after(:create) do |board| after(:create) do |board|
board.lists.create(list_type: :closed) board.lists.create(list_type: :closed)
......
...@@ -5,7 +5,7 @@ FactoryGirl.define do ...@@ -5,7 +5,7 @@ FactoryGirl.define do
ref 'master' ref 'master'
active true active true
description "pipeline schedule" description "pipeline schedule"
project factory: :empty_project project
trait :nightly do trait :nightly do
cron '0 1 * * *' cron '0 1 * * *'
......
...@@ -5,7 +5,7 @@ FactoryGirl.define do ...@@ -5,7 +5,7 @@ FactoryGirl.define do
sha '97de212e80737a608d939f648d959671fb0a0142' sha '97de212e80737a608d939f648d959671fb0a0142'
status 'pending' status 'pending'
project factory: :empty_project project
factory :ci_pipeline_without_jobs do factory :ci_pipeline_without_jobs do
after(:build) do |pipeline| after(:build) do |pipeline|
......
FactoryGirl.define do FactoryGirl.define do
factory :ci_runner_project, class: Ci::RunnerProject do factory :ci_runner_project, class: Ci::RunnerProject do
runner factory: :ci_runner runner factory: :ci_runner
project factory: :empty_project project
end end
end end
...@@ -7,6 +7,6 @@ FactoryGirl.define do ...@@ -7,6 +7,6 @@ FactoryGirl.define do
protected true protected true
end end
project factory: :empty_project project
end end
end end
...@@ -3,7 +3,7 @@ require_relative '../support/repo_helpers' ...@@ -3,7 +3,7 @@ require_relative '../support/repo_helpers'
FactoryGirl.define do FactoryGirl.define do
factory :commit do factory :commit do
git_commit RepoHelpers.sample_commit git_commit RepoHelpers.sample_commit
project factory: :empty_project project
initialize_with do initialize_with do
new(git_commit, project) new(git_commit, project)
......
FactoryGirl.define do FactoryGirl.define do
factory :deploy_keys_project do factory :deploy_keys_project do
deploy_key deploy_key
project factory: :empty_project project
end end
end end
...@@ -2,12 +2,10 @@ FactoryGirl.define do ...@@ -2,12 +2,10 @@ FactoryGirl.define do
factory :environment, class: Environment do factory :environment, class: Environment do
sequence(:name) { |n| "environment#{n}" } sequence(:name) { |n| "environment#{n}" }
project factory: :empty_project association :project, :repository
sequence(:external_url) { |n| "https://env#{n}.example.gitlab.com" } sequence(:external_url) { |n| "https://env#{n}.example.gitlab.com" }
trait :with_review_app do |environment| trait :with_review_app do |environment|
project
transient do transient do
ref 'master' ref 'master'
end end
......
FactoryGirl.define do FactoryGirl.define do
factory :event do factory :event do
project factory: :empty_project project
author factory: :user author factory: :user
trait(:created) { action Event::CREATED } trait(:created) { action Event::CREATED }
......
...@@ -2,7 +2,7 @@ FactoryGirl.define do ...@@ -2,7 +2,7 @@ FactoryGirl.define do
factory :file_uploader do factory :file_uploader do
skip_create skip_create
project factory: :empty_project project
secret nil secret nil
transient do transient do
......
FactoryGirl.define do FactoryGirl.define do
factory :forked_project_link do factory :forked_project_link do
association :forked_to_project, factory: :project association :forked_to_project, factory: [:project, :repository]
association :forked_from_project, factory: :project association :forked_from_project, factory: [:project, :repository]
after(:create) do |link| after(:create) do |link|
link.forked_from_project.reload link.forked_from_project.reload
...@@ -9,7 +9,7 @@ FactoryGirl.define do ...@@ -9,7 +9,7 @@ FactoryGirl.define do
end end
trait :forked_to_empty_project do trait :forked_to_empty_project do
association :forked_to_project, factory: :empty_project association :forked_to_project, factory: [:project, :repository]
end end
end end
end end
...@@ -2,7 +2,7 @@ FactoryGirl.define do ...@@ -2,7 +2,7 @@ FactoryGirl.define do
factory :issue do factory :issue do
title { generate(:title) } title { generate(:title) }
author author
project factory: :empty_project project
trait :confidential do trait :confidential do
confidential true confidential true
......
FactoryGirl.define do FactoryGirl.define do
factory :label_priority do factory :label_priority do
project factory: :empty_project project
label label
sequence(:priority) sequence(:priority)
end end
......
...@@ -5,7 +5,7 @@ FactoryGirl.define do ...@@ -5,7 +5,7 @@ FactoryGirl.define do
end end
factory :label, traits: [:base_label], class: ProjectLabel do factory :label, traits: [:base_label], class: ProjectLabel do
project factory: :empty_project project
transient do transient do
priority nil priority nil
......
...@@ -27,7 +27,7 @@ FactoryGirl.define do ...@@ -27,7 +27,7 @@ FactoryGirl.define do
elsif evaluator.project_id elsif evaluator.project_id
milestone.project_id = evaluator.project_id milestone.project_id = evaluator.project_id
else else
milestone.project = create(:empty_project) milestone.project = create(:project)
end end
end end
......
...@@ -4,7 +4,7 @@ include ActionDispatch::TestProcess ...@@ -4,7 +4,7 @@ include ActionDispatch::TestProcess
FactoryGirl.define do FactoryGirl.define do
factory :note do factory :note do
project factory: :empty_project project
note { generate(:title) } note { generate(:title) }
author author
on_issue on_issue
......
FactoryGirl.define do FactoryGirl.define do
factory :notification_setting do factory :notification_setting do
source factory: :empty_project source factory: :project
user user
level 3 level 3
events [] events []
......
FactoryGirl.define do FactoryGirl.define do
factory :project_group_link do factory :project_group_link do
project factory: :empty_project project
group group
end end
end end
...@@ -2,7 +2,7 @@ FactoryGirl.define do ...@@ -2,7 +2,7 @@ FactoryGirl.define do
factory :project_hook do factory :project_hook do
url { generate(:url) } url { generate(:url) }
enable_ssl_verification false enable_ssl_verification false
project factory: :empty_project project
trait :token do trait :token do
token { SecureRandom.hex(10) } token { SecureRandom.hex(10) }
......
FactoryGirl.define do FactoryGirl.define do
factory :project_member do factory :project_member do
user user
project factory: :empty_project project
master master
trait(:guest) { access_level ProjectMember::GUEST } trait(:guest) { access_level ProjectMember::GUEST }
......
...@@ -2,7 +2,7 @@ FactoryGirl.define do ...@@ -2,7 +2,7 @@ FactoryGirl.define do
factory :project_wiki do factory :project_wiki do
skip_create skip_create
project factory: :empty_project project
user factory: :user user factory: :user
initialize_with { new(project, user) } initialize_with { new(project, user) }
end end
......
...@@ -68,9 +68,7 @@ FactoryGirl.define do ...@@ -68,9 +68,7 @@ FactoryGirl.define do
avatar { File.open(Rails.root.join('spec/fixtures/dk.png')) } avatar { File.open(Rails.root.join('spec/fixtures/dk.png')) }
end end
# Project with test repository # Test repository - https://gitlab.com/gitlab-org/gitlab-test
#
# Repository source is at https://gitlab.com/gitlab-org/gitlab-test
trait :repository do trait :repository do
path { 'gitlabhq' } path { 'gitlabhq' }
......
...@@ -2,6 +2,6 @@ FactoryGirl.define do ...@@ -2,6 +2,6 @@ FactoryGirl.define do
factory :release do factory :release do
tag "v1.1.0" tag "v1.1.0"
description "Awesome release" description "Awesome release"
project factory: :empty_project project
end end
end end
FactoryGirl.define do FactoryGirl.define do
factory :sent_notification do factory :sent_notification do
project factory: :empty_project project
recipient factory: :user recipient factory: :user
noteable { create(:issue, project: project) } noteable { create(:issue, project: project) }
reply_key { SentNotification.reply_key } reply_key { SentNotification.reply_key }
......
FactoryGirl.define do FactoryGirl.define do
factory :service do factory :service do
project factory: :empty_project project
type 'Service' type 'Service'
end end
factory :custom_issue_tracker_service, class: CustomIssueTrackerService do factory :custom_issue_tracker_service, class: CustomIssueTrackerService do
project factory: :empty_project project
type 'CustomIssueTrackerService' type 'CustomIssueTrackerService'
category 'issue_tracker' category 'issue_tracker'
active true active true
...@@ -17,7 +17,7 @@ FactoryGirl.define do ...@@ -17,7 +17,7 @@ FactoryGirl.define do
end end
factory :kubernetes_service do factory :kubernetes_service do
project factory: :empty_project project
active true active true
properties({ properties({
api_url: 'https://kubernetes.example.com', api_url: 'https://kubernetes.example.com',
...@@ -26,7 +26,7 @@ FactoryGirl.define do ...@@ -26,7 +26,7 @@ FactoryGirl.define do
end end
factory :prometheus_service do factory :prometheus_service do
project factory: :empty_project project
active true active true
properties({ properties({
api_url: 'https://prometheus.example.com/' api_url: 'https://prometheus.example.com/'
...@@ -34,7 +34,7 @@ FactoryGirl.define do ...@@ -34,7 +34,7 @@ FactoryGirl.define do
end end
factory :jira_service do factory :jira_service do
project factory: :empty_project project
active true active true
properties( properties(
url: 'https://jira.example.com', url: 'https://jira.example.com',
...@@ -43,7 +43,7 @@ FactoryGirl.define do ...@@ -43,7 +43,7 @@ FactoryGirl.define do
end end
factory :hipchat_service do factory :hipchat_service do
project factory: :empty_project project
type 'HipchatService' type 'HipchatService'
token 'test_token' token 'test_token'
end end
......
...@@ -20,7 +20,7 @@ FactoryGirl.define do ...@@ -20,7 +20,7 @@ FactoryGirl.define do
end end
factory :project_snippet, parent: :snippet, class: :ProjectSnippet do factory :project_snippet, parent: :snippet, class: :ProjectSnippet do
project factory: :empty_project project
end end
factory :personal_snippet, parent: :snippet, class: :PersonalSnippet do factory :personal_snippet, parent: :snippet, class: :PersonalSnippet do
......
FactoryGirl.define do FactoryGirl.define do
factory :subscription do factory :subscription do
user user
project factory: :empty_project project
subscribable factory: :issue subscribable factory: :issue
end end
end end
FactoryGirl.define do FactoryGirl.define do
factory :todo do factory :todo do
project factory: :empty_project project
author author
user user
target factory: :issue target factory: :issue
...@@ -45,7 +45,7 @@ FactoryGirl.define do ...@@ -45,7 +45,7 @@ FactoryGirl.define do
end end
factory :on_commit_todo, class: Todo do factory :on_commit_todo, class: Todo do
project factory: :empty_project project
author author
user user
action { Todo::ASSIGNED } action { Todo::ASSIGNED }
......
FactoryGirl.define do FactoryGirl.define do
factory :upload do factory :upload do
model { build(:empty_project) } model { build(:project) }
path { "uploads/-/system/project/avatar/avatar.jpg" } path { "uploads/-/system/project/avatar/avatar.jpg" }
size 100.kilobytes size 100.kilobytes
uploader "AvatarUploader" uploader "AvatarUploader"
......
...@@ -3,7 +3,7 @@ require 'rails_helper' ...@@ -3,7 +3,7 @@ require 'rails_helper'
feature 'Admin disables Git access protocol' do feature 'Admin disables Git access protocol' do
include StubENV include StubENV
let(:project) { create(:empty_project, :empty_repo) } let(:project) { create(:project, :empty_repo) }
let(:admin) { create(:admin) } let(:admin) { create(:admin) }
background do background do
......
...@@ -166,7 +166,7 @@ feature 'Admin Groups' do ...@@ -166,7 +166,7 @@ feature 'Admin Groups' do
describe 'shared projects' do describe 'shared projects' do
it 'renders shared project' do it 'renders shared project' do
empty_project = create(:empty_project) empty_project = create(:project)
empty_project.project_group_links.create!( empty_project.project_group_links.create!(
group_access: Gitlab::Access::MASTER, group_access: Gitlab::Access::MASTER,
group: group group: group
......
require 'spec_helper' require 'spec_helper'
feature 'Admin::HookLogs' do feature 'Admin::HookLogs' do
let(:project) { create(:empty_project) } let(:project) { create(:project) }
let(:system_hook) { create(:system_hook) } let(:system_hook) { create(:system_hook) }
let(:hook_log) { create(:web_hook_log, web_hook: system_hook, internal_error_message: 'some error') } let(:hook_log) { create(:web_hook_log, web_hook: system_hook, internal_error_message: 'some error') }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment