Commit 72a7b30c authored by Robert Speicher's avatar Robert Speicher

Change all `:empty_project` to `:project`

parent e2c3dca3
......@@ -66,7 +66,7 @@ class Spinach::Features::ExploreGroups < Spinach::FeatureSteps
def group_has_project(groupname, projectname, visibility_level)
group = Group.find_by(name: groupname) || create(:group, name: groupname)
project = create(:empty_project,
project = create(:project,
namespace: group,
name: projectname,
path: "#{groupname}-#{projectname}",
......
......@@ -100,7 +100,7 @@ class Spinach::Features::GroupMilestones < Spinach::FeatureSteps
group = owned_group
%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
create(:label, project: project, title: 'bug')
......
......@@ -15,7 +15,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
step 'Group "Owned" has a public project "Public-project"' do
group = owned_group
@project = create :empty_project, :public,
@project = create :project, :public,
group: group,
name: "Public-project"
end
......@@ -109,7 +109,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
step 'Group "Owned" has archived project' do
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
step 'I should see "archived" label' do
......
......@@ -47,11 +47,11 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps
end
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]
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]
create(:deploy_keys_project, project: @third_project, deploy_key: @second_project.deploy_keys.first)
end
......
......@@ -4,11 +4,11 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps
include SharedProject
step 'public project "Community"' do
create(:empty_project, :public, name: 'Community')
create(:project, :public, name: 'Community')
end
step 'private project "Enterprise"' do
create(:empty_project, :private, name: 'Enterprise')
create(:project, :private, name: 'Enterprise')
end
step 'I visit project "Community" page' do
......
......@@ -34,7 +34,7 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps
end
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]
end
......@@ -68,7 +68,7 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps
step 'I share project with group "OpenSource"' do
project = Project.find_by(name: 'Shop')
os_group = create(:group, name: 'OpenSource')
create(:empty_project, group: os_group)
create(:project, group: os_group)
@os_user1 = create(:user)
@os_user2 = create(:user)
os_group.add_owner(@os_user1)
......
......@@ -9,7 +9,7 @@ module SharedProject
step "I own a project in some group namespace" do
@group = create(:group, name: 'some group')
@project = create(:empty_project, namespace: @group)
@project = create(:project, namespace: @group)
@project.team << [@user, :master]
end
......@@ -54,7 +54,7 @@ module SharedProject
# Create an empty project without caring about the name
step 'I own an empty project' do
@project = create(:empty_project,
@project = create(:project,
name: 'Empty Project', namespace: @user.namespace)
@project.team << [@user, :master]
end
......@@ -276,7 +276,7 @@ module SharedProject
def user_owns_project(user_name:, project_name:, visibility: :private)
user = user_exists(user_name, username: user_name.gsub(/\s/, '').underscore)
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]
end
end
......@@ -38,6 +38,6 @@ class Spinach::Features::User < Spinach::FeatureSteps
end
def contributed_project
@contributed_project ||= create(:empty_project, :public)
@contributed_project ||= create(:project, :public)
end
end
......@@ -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)}
......
......@@ -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
......
......@@ -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
......
require 'spec_helper'
describe Admin::ProjectsController do
let!(:project) { create(:empty_project, :public) }
let!(:project) { create(:project, :public) }
before do
sign_in(create(:admin))
......
......@@ -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,
......
......@@ -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
......
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)
......
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
......
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
......
......@@ -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
......
......@@ -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]
......
......@@ -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)
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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')