Commit f81df0d4 authored by Robert Speicher's avatar Robert Speicher

Remove EE-specific usages of `:empty_project`

parent 17f36d4b
......@@ -14,12 +14,12 @@ class Spinach::Features::GroupHooks < Spinach::FeatureSteps
end
step 'I own project "Shop" in group "Sourcing"' do
@project = create(:project,
@project = create(:project, :repository,
name: 'Shop', group: @group)
end
step 'I own empty project "Empty Shop" in group "Sourcing"' do
@project = create(:empty_project,
@project = create(:project,
name: 'Shop', group: @group)
end
......
......@@ -16,7 +16,7 @@ class Spinach::Features::ProjectSearch < Spinach::FeatureSteps
end
step 'project has all data available for the search' do
@project = create :project
@project = create :project, :repository
@project.team << [current_user, :master]
@issue = create :issue, title: 'bla-bla initial', project: @project
......
require 'spec_helper'
describe Projects::BoardsController do # rubocop:disable RSpec/FilePath
let(:project) { create(:empty_project) }
let(:project) { create(:project) }
let(:user) { create(:user) }
before do
......
require('spec_helper')
describe ProjectsController do # rubocop:disable RSpec/FilePath
let(:project) { create(:empty_project) }
let(:project) { create(:project) }
let(:user) { create(:user) }
before do
......
......@@ -3,7 +3,7 @@ require 'rails_helper'
describe Projects::ApproverGroupsController do
describe '#destroy' do
let(:user) { create(:user) }
let(:project) { create(:empty_project) }
let(:project) { create(:project) }
let(:merge_request) { create(:merge_request, source_project: project) }
before do
......
......@@ -3,7 +3,7 @@ require 'rails_helper'
describe Projects::ApproversController do
describe '#destroy' do
let(:user) { create(:user) }
let(:project) { create(:empty_project) }
let(:project) { create(:project) }
let(:merge_request) { create(:merge_request, source_project: project) }
before do
......
......@@ -78,7 +78,7 @@ describe Projects::IssuesController do
end
describe 'issue weights' do
let(:project) { create(:empty_project) }
let(:project) { create(:project) }
let(:user) { create(:user) }
let(:issue) { create(:issue, project: project, weight: 5) }
let(:issue2) { create(:issue, project: project, weight: 1) }
......
......@@ -80,7 +80,7 @@ describe Projects::MergeRequests::CreationsController do
context 'when the target project is a fork of a deleted project' do
before do
original_project = create(:empty_project)
original_project = create(:project)
project.update_attributes(forked_from_project: original_project, approvals_before_merge: 4)
original_project.update_attributes(pending_delete: true)
......
......@@ -95,7 +95,7 @@ describe Projects::MirrorsController do
end
context 'when project does not have a mirror' do
let(:project) { create(:empty_project) }
let(:project) { create(:project) }
it 'allows to create a mirror' do
expect_any_instance_of(EE::Project).to receive(:force_import_job!)
......@@ -107,7 +107,7 @@ describe Projects::MirrorsController do
end
context 'when project has a mirror' do
let(:project) { create(:empty_project, :mirror, :import_finished) }
let(:project) { create(:project, :mirror, :import_finished) }
it 'is able to disable the mirror' do
expect { do_put(project, mirror: false) }.to change { Project.mirror.count }.to(0)
......@@ -119,7 +119,7 @@ describe Projects::MirrorsController do
it 'forces update' do
expect_any_instance_of(EE::Project).to receive(:force_import_job!)
project = create(:empty_project, :mirror)
project = create(:project, :mirror)
sign_in(project.owner)
put :update_now, { namespace_id: project.namespace.to_param, project_id: project.to_param }
......
require 'spec_helper'
describe Projects::PushRulesController do
let(:project) { create(:empty_project, push_rule: create(:push_rule, prevent_secrets: false)) }
let(:project) { create(:project, push_rule: create(:push_rule, prevent_secrets: false)) }
let(:user) { create(:user) }
before do
......
require 'spec_helper'
describe Projects::Settings::SlacksController do
let(:project) { create(:empty_project, :public) }
let(:project) { create(:project, :public) }
let(:user) { create(:user) }
before do
......
......@@ -8,7 +8,7 @@ FactoryGirl.define do
trait :project_event do
entity_type 'Project'
entity_id { create(:empty_project).id }
entity_id { create(:project).id }
end
trait :group_event do
......
......@@ -9,7 +9,7 @@ FactoryGirl.define do
end
trait :forked_to_empty_project do
association :forked_to_project, factory: [:project, :repository]
association :forked_to_project, factory: :project
end
end
end
......@@ -7,6 +7,6 @@ FactoryGirl.define do
source 0
branches_affected 0
tags_affected 0
project factory: :empty_project
project
end
end
FactoryGirl.define do
factory :geo_project_registry, class: Geo::ProjectRegistry do
project factory: :empty_project
project
last_repository_synced_at nil
last_repository_successful_sync_at nil
last_wiki_synced_at nil
......
......@@ -49,7 +49,7 @@ FactoryGirl.define do
end
factory :gitlab_slack_application_service do
project factory: :empty_project
project
type 'GitlabSlackApplicationService'
end
end
......@@ -3,7 +3,7 @@ require 'spec_helper'
describe "Admin::Emails", :js do
let!(:current_user) { create(:admin) }
let!(:group) { create(:group) }
let!(:project) { create(:empty_project, namespace: group) }
let!(:project) { create(:project, namespace: group) }
describe "GET /admin/email" do
before do
......
......@@ -213,7 +213,7 @@ describe "Admin::Users" do
context 'with projects with shared runners enabled' do
before do
create(:empty_project, namespace: user.namespace, shared_runners_enabled: true)
create(:project, namespace: user.namespace, shared_runners_enabled: true)
end
it 'shows quota' do
......@@ -227,7 +227,7 @@ describe "Admin::Users" do
context 'without projects with shared runners enabled' do
before do
create(:empty_project, namespace: user.namespace, shared_runners_enabled: false)
create(:project, namespace: user.namespace, shared_runners_enabled: false)
end
it 'does not show quota' do
......@@ -304,7 +304,7 @@ describe "Admin::Users" do
end
describe 'Update shared runners quota' do
let!(:project) { create(:empty_project, namespace: user.namespace, shared_runners_enabled: true) }
let!(:project) { create(:project, namespace: user.namespace, shared_runners_enabled: true) }
before do
fill_in "user_namespace_attributes_shared_runners_minutes_limit", with: "500"
......
......@@ -2,7 +2,7 @@ require 'rails_helper'
describe 'Board with milestone', :js do
let(:user) { create(:user) }
let(:project) { create(:empty_project, :public) }
let(:project) { create(:project, :public) }
let!(:milestone) { create(:milestone, project: project) }
let!(:issue) { create(:closed_issue, project: project) }
let!(:issue_milestone) { create(:closed_issue, project: project, milestone: milestone) }
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'issue boards', :js do
let(:user) { create(:user) }
let(:project) { create(:empty_project, :public) }
let(:project) { create(:project, :public) }
let!(:board) { create(:board, project: project) }
before do
......
......@@ -3,7 +3,7 @@ require 'rails_helper'
describe 'Issue Boards', :js 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!(:stretch) { create(:label, project: project, name: 'Stretch') }
......
......@@ -2,7 +2,7 @@ require 'rails_helper'
describe 'Multiple Issue Boards', :js do
let(:user) { create(:user) }
let(:project) { create(:empty_project, :public) }
let(:project) { create(:project, :public) }
let!(:planning) { create(:label, project: project, name: 'Planning') }
let!(:board) { create(:board, project: project) }
let!(:board2) { create(:board, project: project) }
......
......@@ -5,7 +5,7 @@ feature 'CI shared runner settings' do
let(:admin) { create(:admin) }
let(:group) { create(:group, :with_build_minutes) }
let!(:project) { create(:empty_project, namespace: group, shared_runners_enabled: true) }
let!(:project) { create(:project, namespace: group, shared_runners_enabled: true) }
before do
stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false')
......
......@@ -3,7 +3,7 @@ require 'spec_helper'
feature 'Groups > Contribution Analytics', :js do
let(:user) { create(:user) }
let(:group) { create(:group) }
let(:empty_project) { create(:empty_project, namespace: group) }
let(:empty_project) { create(:project, namespace: group) }
before do
group.add_owner(user)
......
......@@ -7,7 +7,7 @@ feature 'Groups > Members > Master/Owner can override LDAP access levels' do
let(:maryjane) { create(:user, name: 'Mary Jane') }
let(:owner) { create(:user) }
let(:group) { create(:group_with_ldap_group_link, :public) }
let(:project) { create(:empty_project, namespace: group) }
let(:project) { create(:project, namespace: group) }
let!(:owner_member) { create(:group_member, :owner, group: group, user: owner) }
let!(:ldap_member) { create(:group_member, :guest, group: group, user: johndoe, ldap: true) }
......
......@@ -3,7 +3,7 @@ require 'spec_helper'
feature 'Groups > Pipeline Quota' do
let(:user) { create(:user) }
let(:group) { create(:group) }
let!(:project) { create(:empty_project, namespace: group, shared_runners_enabled: true) }
let!(:project) { create(:project, namespace: group, shared_runners_enabled: true) }
before do
group.add_owner(user)
......@@ -33,7 +33,7 @@ feature 'Groups > Pipeline Quota' do
context 'with no projects using shared runners' do
let(:group) { create(:group, :with_not_used_build_minutes_limit) }
let!(:project) { create(:empty_project, namespace: group, shared_runners_enabled: false) }
let!(:project) { create(:project, namespace: group, shared_runners_enabled: false) }
it 'is not linked within the group settings dropdown' do
visit edit_group_path(group)
......@@ -77,7 +77,7 @@ feature 'Groups > Pipeline Quota' do
context 'minutes over quota' do
let(:group) { create(:group, :with_used_build_minutes_limit) }
let!(:other_project) { create(:empty_project, namespace: group, shared_runners_enabled: false) }
let!(:other_project) { create(:project, namespace: group, shared_runners_enabled: false) }
it 'is linked within the group settings tab' do
visit edit_group_path(group)
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'Issues csv' do
let(:user) { create(:user) }
let(:project) { create(:empty_project, :public) }
let(:project) { create(:project, :public) }
let(:milestone) { create(:milestone, title: 'v1.0', project: project) }
let(:idea_label) { create(:label, project: project, title: 'Idea') }
let(:feature_label) { create(:label, project: project, title: 'Feature') }
......
......@@ -5,7 +5,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) }
......
......@@ -3,7 +3,7 @@ require 'rails_helper'
describe 'Dropdown weight', :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_weight) { '#js-dropdown-weight' }
......
......@@ -3,7 +3,7 @@ require 'rails_helper'
describe 'Filter issues weight', :js do
include FilteredSearchHelpers
let!(:project) { create(:empty_project) }
let!(:project) { create(:project) }
let!(:user) { create(:user, name: 'administrator', username: 'root') }
let(:js_dropdown_weight) { '#js-dropdown-weight' }
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'Issues sub nav EE' do
let(:user) { create(:user) }
let(:project) { create(:empty_project) }
let(:project) { create(:project) }
before do
project.add_master(user)
......
......@@ -3,7 +3,7 @@ require 'spec_helper'
feature 'Profile > Pipeline Quota' do
let(:user) { create(:user) }
let(:namespace) { create(:namespace, owner: user) }
let!(:project) { create(:empty_project, namespace: namespace, shared_runners_enabled: true) }
let!(:project) { create(:project, namespace: namespace, shared_runners_enabled: true) }
before do
gitlab_sign_in(user)
......@@ -32,7 +32,7 @@ feature 'Profile > Pipeline Quota' do
context 'with no projects using shared runners' do
let(:namespace) { create(:namespace, :with_not_used_build_minutes_limit, owner: user) }
let!(:project) { create(:empty_project, namespace: namespace, shared_runners_enabled: false) }
let!(:project) { create(:project, namespace: namespace, shared_runners_enabled: false) }
it 'shows correct group quota info' do
visit profile_pipeline_quota_path
......@@ -64,7 +64,7 @@ feature 'Profile > Pipeline Quota' do
context 'minutes over quota' do
let(:namespace) { create(:namespace, :with_used_build_minutes_limit, owner: user) }
let!(:other_project) { create(:empty_project, namespace: namespace, shared_runners_enabled: false) }
let!(:other_project) { create(:project, namespace: namespace, shared_runners_enabled: false) }
it 'shows correct group quota and projects info' do
visit profile_pipeline_quota_path
......
......@@ -3,7 +3,7 @@ require 'rails_helper'
feature 'Geo clone instructions', :js do
include Devise::Test::IntegrationHelpers
let(:project) { create(:empty_project, :empty_repo) }
let(:project) { create(:project, :empty_repo) }
let(:developer) { create(:user) }
background do
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'Projects > Members > Member is removed from project' do
let(:user) { create(:user) }
let(:project) { create(:empty_project) }
let(:project) { create(:project) }
background do
project.team << [user, :master]
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'Milestones on EE' 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, start_date: Date.today, due_date: 7.days.from_now) }
before do
......
......@@ -4,7 +4,7 @@ describe 'Project settings > [EE] Merge Requests', :js do
include GitlabRoutingHelper
let(:user) { create(:user) }
let(:project) { create(:empty_project, approvals_before_merge: 1) }
let(:project) { create(:project, approvals_before_merge: 1) }
before do
gitlab_sign_in(user)
......
......@@ -4,7 +4,7 @@ describe 'Project settings > [EE] Merge Requests', :js do
include GitlabRoutingHelper
let(:user) { create(:user) }
let(:project) { create(:empty_project, approvals_before_merge: 1) }
let(:project) { create(:project, approvals_before_merge: 1) }
let(:group) { create(:group) }
let(:group_member) { create(:user) }
let(:non_member) { create(:user) }
......
require 'spec_helper'
feature 'Slack application' do
let(:project) { create(:empty_project) }
let(:project) { create(:project) }
let(:user) { create(:user) }
let(:role) { :developer }
let(:service) { create(:gitlab_slack_application_service, project: project) }
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'Project variables EE', 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') }
let(:variable_environment_scope) { true }
......
......@@ -5,7 +5,7 @@ describe EE::GitlabRoutingHelper do
include ApplicationSettingsHelper
let!(:primary_node) { create(:geo_node, :primary) }
let(:project) { build_stubbed(:empty_project) }
let(:project) { build_stubbed(:project) }
describe '#geo_primary_default_url_to_repo' do
it 'returns an HTTP URL' do
......
......@@ -21,7 +21,7 @@ describe Audit::Details do
context 'project' do
let(:user_member) { create(:user) }
let(:project) { create(:empty_project) }
let(:project) { create(:project) }
let(:member) { create(:project_member, :developer, user: user_member, project: project) }
let(:member_access_action) do
{
......
......@@ -237,7 +237,7 @@ describe EE::Gitlab::LDAP::Sync::Group do
end
it 'updates projects authorizations' do
project = create(:empty_project, namespace: group)
project = create(:project, namespace: group)
group.add_user(user, Gitlab::Access::MASTER)
sync_group.update_permissions
......
......@@ -17,7 +17,7 @@ describe Gitlab::Elastic::Indexer do
let(:popen_failure) { [['error'], 1] }
context 'empty project' do
let(:project) { create(:empty_project) }
let(:project) { create(:project) }
it 'updates the index status without running the indexing command' do
expect_popen.never
......
......@@ -64,7 +64,7 @@ describe Gitlab::Elastic::ProjectSearchResults do
context 'visibility checks' do
it 'shows wiki for guests' do
project = create :empty_project, :public
project = create :project, :public
guest = create :user
project.add_guest(guest)
......@@ -125,7 +125,7 @@ describe Gitlab::Elastic::ProjectSearchResults do
end
describe 'search for blobs in non-default branch' do
let(:project) { create(:project, :public, :repository_private) }
let(:project) { create(:project, :public, :repository, :repository_private) }
let(:result) { described_class.new(user, 'initial', project.id, 'test') }
subject(:blobs) { result.objects('blobs') }
......
......@@ -77,8 +77,8 @@ describe Gitlab::Elastic::SearchResults do
end
describe 'confidential issues' do
let(:project_3) { create(:empty_project) }
let(:project_4) { create(:empty_project) }
let(:project_3) { create(:project) }
let(:project_4) { create(:project) }
let(:limit_project_ids) { [project_1.id, project_2.id, project_3.id] }
let(:author) { create(:user) }
let(:assignee) { create(:user) }
......
......@@ -12,7 +12,7 @@ describe Gitlab::Email::Handler::EE::ServiceDeskHandler do
let(:namespace) { create(:namespace, name: "email") }
context 'service desk is enabled for the project' do
let(:project) { create(:empty_project, :public, namespace: namespace, path: 'test', service_desk_enabled: true) }
let(:project) { create(:project, :public, namespace: namespace, path: 'test', service_desk_enabled: true) }
before do
allow(Notify).to receive(:service_desk_thank_you_email)
......@@ -85,7 +85,7 @@ describe Gitlab::Email::Handler::EE::ServiceDeskHandler do
end
context 'service desk is disabled for the project' do
let(:project) { create(:empty_project, :public, namespace: namespace, path: 'test') }
let(:project) { create(:project, :public, namespace: namespace, path: 'test') }
it 'bounces the email' do
expect { receiver.execute }.to raise_error(Gitlab::Email::ProcessingError)
......
require 'spec_helper'
describe Gitlab::PathLocksFinder do
let(:project) { create :empty_project }
let(:project) { create :project }
let(:user) { create :user }
let(:finder) { described_class.new(project) }
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe Gitlab::RepositorySizeError do
let(:project) do
create(:empty_project, statistics: build(:project_statistics, repository_size: 15.megabytes))
create(:project, statistics: build(:project_statistics, repository_size: 15.megabytes))
end
let(:message) { described_class.new(project) }
......
require 'spec_helper'
describe Gitlab::UsageData do
let(:project) { create(:empty_project) }
let(:project) { create(:project) }
let(:projects) { create_list(:project, 3) }
let!(:board) { create(:board, project: projects[0]) }
......
......@@ -7,7 +7,7 @@ describe Emails::CsvExport do
describe 'csv export email' do
let(:user) { create(:user) }
let(:empty_project) { create(:empty_project, path: 'myproject') }
let(:empty_project) { create(:project, path: 'myproject') }
let(:export_status) { { truncated: false, rows_expected: 3, rows_written: 3 } }
subject { Notify.issues_csv_email(user, empty_project, "dummy content", export_status) }
let(:attachment) { subject.attachments.first }
......
......@@ -11,7 +11,7 @@ describe Issue, elastic: true do
stub_application_setting(elasticsearch_search: false, elasticsearch_indexing: false)
end
let(:project) { create :empty_project }
let(:project) { create :project }
it "searches issues" do
Sidekiq::Testing.inline! do
......
......@@ -12,7 +12,7 @@ describe Milestone, elastic: true do
end
it "searches milestones" do
project = create :empty_project
project = create :project
Sidekiq::Testing.inline! do
create :milestone, title: 'bla-bla term1', project: project
......
......@@ -15,10 +15,10 @@ describe Project, elastic: true do
project_ids = []
Sidekiq::Testing.inline! do
project = create :empty_project, name: 'test1'
project1 = create :empty_project, path: 'test2', description: 'awesome project'
project2 = create :empty_project
create :empty_project, path: 'someone_elses_project'
project = create :project, name: 'test1'
project1 = create :project, path: 'test2', description: 'awesome project'
project2 = create :project
create :project, path: 'someone_elses_project'
project_ids += [project.id, project1.id, project2.id]
Gitlab::Elastic::Helper.refresh_index
......@@ -35,8 +35,8 @@ describe Project, elastic: true do
project_ids = []
Sidekiq::Testing.inline! do
project = create :empty_project, name: 'tesla-model-s'
project1 = create :empty_project, name: 'tesla_model_s'
project = create :project, name: 'tesla-model-s'
project1 = create :project, name: 'tesla_model_s'
project_ids += [project.id, project1.id]
Gitlab::Elastic::Helper.refresh_index
......@@ -46,7 +46,7 @@ describe Project, elastic: true do
end
it "returns json with all needed elements" do
project = create :empty_project
project = create :project
expected_hash = project.attributes.extract!(
'id',
......
......@@ -12,7 +12,7 @@ describe ProjectWiki, elastic: true do
end
it "searches wiki page" do
project = create :empty_project
project = create :project
Sidekiq::Testing.inline! do
project.wiki.create_page("index_page", "Bla bla term1")
......
......@@ -13,7 +13,7 @@ describe Snippet, elastic: true do
context 'searching snippets by code' do
let!(:author) { create(:user) }
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') }
......
......@@ -143,7 +143,7 @@ describe Namespace do
context 'with project' do
context 'and disabled shared runners' do
let!(:project) do
create(:empty_project,
create(:project,
namespace: namespace,
shared_runners_enabled: false)
end
......@@ -153,7 +153,7 @@ describe Namespace do
context 'and enabled shared runners' do
let!(:project) do
create(:empty_project,
create(:project,
namespace: namespace,
shared_runners_enabled: true)
end
......@@ -196,7 +196,7 @@ describe Namespace do
context 'with project' do
let!(:project) do
create(:empty_project,
create(:project,
namespace: namespace,
shared_runners_enabled: true)
end
......@@ -224,7 +224,7 @@ describe Namespace do
context 'with project' do
let!(:project) do
create(:empty_project,
create(:project,
namespace: namespace,
shared_runners_enabled: true)
end
......
......@@ -17,7 +17,7 @@ describe Project do
end
describe '#push_rule' do
let(:project) { create(:empty_project, push_rule: create(:push_rule)) }
let(:project) { create(:project, push_rule: create(:push_rule)) }
subject(:push_rule) { project.push_rule(true) }
......@@ -35,7 +35,7 @@ describe Project do
describe "#execute_hooks" do
context "group hooks" do
let(:group) { create(:group) }
let(:project) { create(:empty_project, namespace: group) }
let(:project) { create(:project, namespace: group) }
let(:group_hook) { create(:group_hook, group: group, push_events: true) }
it 'executes the hook when the feature is enabled' do
......@@ -63,7 +63,7 @@ describe Project do
describe '#execute_hooks' do
it "triggers project and group hooks" do
group = create :group, name: 'gitlab'
project = create(:empty_project, name: 'gitlabhq', namespace: group)
project = create(:project, name: 'gitlabhq', namespace: group)
project_hook = create(:project_hook, push_events: true, project: project)
group_hook = create(:group_hook, push_events: true, group: group)
......@@ -78,7 +78,7 @@ describe Project do
end
describe '#allowed_to_share_with_group?' do
let(:project) { create(:empty_project) }
let(:project) { create(:project) }
it "returns true" do
expect(project.allowed_to_share_with_group?).to be_truthy
......@@ -92,7 +92,7 @@ describe Project do
describe '#feature_available?' do
let(:namespace) { build_stubbed(:namespace) }
let(:project) { build_stubbed(:empty_project, namespace: namespace) }
let(:project) { build_stubbed(:project, namespace: namespace) }
let(:user) { build_stubbed(:user) }
subject { project.feature_available?(feature, user) }
......@@ -198,7 +198,7 @@ describe Project do
describe '#mirror_waiting_duration' do
it 'returns in seconds the time spent in the queue' do
project = create(:empty_project, :mirror, :import_scheduled)
project = create(:project, :mirror, :import_scheduled)
mirror_data = project.mirror_data
mirror_data.update_attributes(last_update_started_at: mirror_data.last_update_scheduled_at + 5.minutes)
......@@ -209,7 +209,7 @@ describe Project do
describe '#mirror_update_duration' do
it 'returns in seconds the time spent updating' do
project = create(:empty_project, :mirror, :import_started)
project = create(:project, :mirror, :import_started)
project.update_attributes(mirror_last_update_at: project.mirror_data.last_update_started_at + 5.minutes)
......@@ -218,7 +218,7 @@ describe Project do
end
describe '#has_remote_mirror?' do
let(:project) { create(:empty_project, :remote_mirror, :import_started) }
let(:project) { create(:project, :remote_mirror, :import_started) }
subject { project.has_remote_mirror? }
before do
......@@ -243,7 +243,7 @@ describe Project do
end
describe '#update_remote_mirrors' do
let(:project) { create(:empty_project, :remote_mirror, :import_started) }
let(:project) { create(:project, :remote_mirror, :import_started) }
delegate :update_remote_mirrors, to: :project
before do
......@@ -274,7 +274,7 @@ describe Project do
end
describe '#any_runners_limit' 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) }
......@@ -296,7 +296,7 @@ describe Project do
context 'with used pipeline minutes' do
let(:namespace) { create(:namespace, :with_used_build_minutes_limit) }
let(:project) do
create(:empty_project,
create(:project,
namespace: namespace,
shared_runners_enabled: shared_runners_enabled)
end
......@@ -314,7 +314,7 @@ describe Project do
context 'with used pipeline minutes' do
let(:namespace) { create(:namespace, :with_used_build_minutes_limit) }
let(:project) do
create(:empty_project,
create(:project,
namespace: namespace,
shared_runners_enabled: true)
end
......@@ -330,7 +330,7 @@ describe Project do
end
describe '#shared_runners_minutes_limit_enabled?' do
let(:project) { create(:empty_project) }
let(:project) { create(:project) }
subject { project.shared_runners_minutes_limit_enabled? }
......@@ -379,7 +379,7 @@ describe Project do
end
describe '#size_limit_enabled?' do
let(:project) { create(:empty_project) }
let(:project) { create(:project) }
context 'when repository_size_limit is not configured' do
it 'is disabled' do
......@@ -424,7 +424,7 @@ describe Project do
let!(:license) { create(:license, plan: License::PREMIUM_PLAN) }
let(:namespace) { create(:namespace) }
subject(:project) { build(:empty_project, :private, namespace: namespace, service_desk_enabled: true) }
subject(:project) { build(:project, :private, namespace: namespace, service_desk_enabled: true) }
before do
allow(::Gitlab).to receive(:com?).and_return(true)
......@@ -459,7 +459,7 @@ describe Project do
end
describe '#service_desk_address' do
let(:project) { create(:empty_project, service_desk_enabled: true) }
let(:project) { create(:project, service_desk_enabled: true) }
before do
allow(::EE::Gitlab::ServiceDesk).to receive(:enabled?).and_return(true)
......@@ -473,7 +473,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)
......@@ -647,7 +647,7 @@ describe Project do
].each do |spec|
context spec.inspect do
let(:spec) { spec }
let(:project) { build(:empty_project, approvals_before_merge: spec[:database]) }
let(:project) { build(:project, approvals_before_merge: spec[:database]) }
subject { project.approvals_before_merge }
......@@ -669,7 +669,7 @@ describe Project do
].each do |spec|
context spec.inspect do
let(:spec) { spec }
let(:project) { build(:empty_project, reset_approvals_on_push: spec[:database]) }
let(:project) { build(:project, reset_approvals_on_push: spec[:database]) }
subject { project.reset_approvals_on_push? }
......@@ -691,7 +691,7 @@ describe Project do
].each do |spec|
context spec.inspect do
let(:spec) { spec }
let(:project) { build(:empty_project, approvals_before_merge: spec[:database]) }
let(:project) { build(:project, approvals_before_merge: spec[:database]) }
subject { project.approvals_before_merge }
......@@ -724,7 +724,7 @@ describe Project do
{ ff: false, rebase: false, ff_licensed: false, rebase_licensed: false, method: :merge }
].each do |spec|
context spec.inspect do
let(:project) { build(:empty_project, merge_requests_rebase_enabled: spec[:rebase], merge_requests_ff_only_enabled: spec[:ff]) }
let(:project) { build(:project, merge_requests_rebase_enabled: spec[:rebase], merge_requests_ff_only_enabled: spec[:ff]) }
let(:spec) { spec }
subject { project.merge_method }
......@@ -777,7 +777,7 @@ describe Project do
describe '#disabled_services' do
let(:namespace) { create(:group, :private) }
let(:project) { create(:empty_project, :private, namespace: namespace) }
let(:project) { create(:project, :private, namespace: namespace) }
let(:disabled_services) { %w(jenkins jenkins_deprecated) }
context 'without a license key' do
......
......@@ -10,7 +10,7 @@ describe Geo::ProjectRegistry do
end
describe '.synced' do
let(:project) { create(:empty_project) }
let(:project) { create(:project) }
let(:synced_at) { Time.now }
it 'does not return dirty projects' do
......
......@@ -331,8 +331,8 @@ describe Issue do
describe '#related_issues' do
let(:user) { create(:user) }
let(:authorized_project) { create(:empty_project) }
let(:unauthorized_project) { create(:empty_project) }
let(:authorized_project) { create(:project) }
let(:unauthorized_project) { create(:project) }
let(:authorized_issue_a) { create(:issue, project: authorized_project) }
let(:authorized_issue_b) { create(:issue, project: authorized_project) }
......
......@@ -572,7 +572,7 @@ describe MergeRequest do
end
describe "#number_of_potential_approvers" do
let(:project) { create(:empty_project) }
let(:project) { create(:project) }
let(:author) { create(:user) }
let(:merge_request) { create(:merge_request, source_project: project, author: author) }
......@@ -651,7 +651,7 @@ describe MergeRequest do
describe "#overall_approver_groups" do
it 'returns a merge request group approver' do
project = create :empty_project
project = create :project
create :approver_group, target: project
merge_request = create :merge_request, target_project: project, source_project: project
......@@ -661,7 +661,7 @@ describe MergeRequest do
end
it 'returns a project group approver' do
project = create :empty_project
project = create :project
approver_group1 = create :approver_group, target: project
merge_request = create :merge_request, target_project: project, source_project: project
......@@ -670,7 +670,7 @@ describe MergeRequest do
end
it 'returns a merge request approver if there is no project group approver' do
project = create :empty_project
project = create :project
merge_request = create :merge_request, target_project: project, source_project: project
approver_group1 = create :approver_group, target: merge_request
......@@ -686,7 +686,7 @@ describe MergeRequest do
user2 = create :user
create :user
project = create :empty_project
project = create :project
group = create :group
group.add_master user
create :approver_group, target: project, group: group
......@@ -1520,7 +1520,7 @@ describe MergeRequest do
end
describe 'approvals' do
let(:project) { create(:empty_project) }
let(:project) { create(:project) }
let(:merge_request) { create(:merge_request, source_project: project, author: author) }
let(:author) { create(:user) }
let(:approver) { create(:user) }
......
......@@ -17,7 +17,7 @@ describe ProjectMirrorData, type: :model do
describe 'when create' do
it 'sets next execution timestamp to now' do
project = create(:empty_project)
project = create(:project)
Timecop.freeze(Time.now) do
project.create_mirror_data
......@@ -28,7 +28,7 @@ describe ProjectMirrorData, type: :model do
end
describe '#reset_retry_count!' do
let(:mirror_data) { create(:empty_project, :mirror, :import_finished).mirror_data }
let(:mirror_data) { create(:project, :mirror, :import_finished).mirror_data }
it 'resets retry_count to 0' do
mirror_data.retry_count = 3
......@@ -38,7 +38,7 @@ describe ProjectMirrorData, type: :model do
end
describe '#increment_retry_count!' do
let(:mirror_data) { create(:empty_project, :mirror, :import_finished).mirror_data }
let(:mirror_data) { create(:project, :mirror, :import_finished).mirror_data }
it 'increments retry_count' do
expect { mirror_data.increment_retry_count! }.to change { mirror_data.retry_count }.from(0).to(1)
......@@ -46,7 +46,7 @@ describe ProjectMirrorData, type: :model do
end
describe '#set_next_execution_timestamp!' do
let(:mirror_data) { create(:empty_project, :mirror, :import_finished).mirror_data }
let(:mirror_data) { create(:project, :mirror, :import_finished).mirror_data }
let!(:timestamp) { Time.now }
let!(:jitter) { 2.seconds }
let(:interval) { 2.minutes }
......
......@@ -62,7 +62,7 @@ eos
end
describe 'multiproject enabled' do
let!(:project) { create(:empty_project) }
let!(:project) { create(:project) }
before do
@service = JenkinsDeprecatedService.new
allow(@service).to receive_messages(
......@@ -123,7 +123,7 @@ eos
describe '#execute' do
let(:user) { create(:user, username: 'username') }
let(:namespace) { create(:group, :private) }
let(:project) { create(:empty_project, :private, name: 'project', namespace: namespace) }
let(:project) { create(:project, :private, name: 'project', namespace: namespace) }
let(:push_sample_data) { Gitlab::DataBuilder::Push.build_sample(project, user) }
let(:jenkins_service) { described_class.create(active: true, project: project) }
let!(:service_hook) { create(:service_hook, service: jenkins_service) }
......
......@@ -6,7 +6,7 @@ describe JenkinsService do
it { is_expected.to have_one :service_hook }
end
let(:project) { create(:empty_project) }
let(:project) { create(:project) }
let(:jenkins_url) { 'http://jenkins.example.com/' }
let(:jenkins_hook_url) { jenkins_url + 'project/my_project' }
......@@ -125,7 +125,7 @@ describe JenkinsService do
describe '#test' do
it 'returns the right status' do
user = create(:user, username: 'username')
project = create(:empty_project, name: 'project')
project = create(:project, name: 'project')
push_sample_data = Gitlab::DataBuilder::Push.build_sample(project, user)
jenkins_service = described_class.create(jenkins_params)
stub_request(:post, jenkins_hook_url).with(headers: { 'Authorization' => jenkins_authorization })
......@@ -155,7 +155,7 @@ describe JenkinsService do
describe '#execute' do
let(:user) { create(:user, username: 'username') }
let(:namespace) { create(:group, :private) }
let(:project) { create(:empty_project, :private, name: 'project', namespace: namespace) }
let(:project) { create(:project, :private, name: 'project', namespace: namespace) }
let(:push_sample_data) { Gitlab::DataBuilder::Push.build_sample(project, user) }
let(:jenkins_service) { described_class.create(jenkins_params) }
......@@ -217,7 +217,7 @@ describe JenkinsService 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
......@@ -268,7 +268,7 @@ describe JenkinsService do
context 'when no password was previously set' do
before do
@jenkins_service = described_class.create(
project: create(:empty_project),
project: create(:project),
properties: {
jenkins_url: 'http://jenkins.example.com/',
username: 'jenkins'
......
......@@ -126,7 +126,7 @@ describe Project do
context '#with_wiki_enabled' do
it 'returns a project' do
project = create(:project_empty_repo, wiki_access_level: ProjectFeature::ENABLED)
project1 = create(:empty_project, wiki_access_level: ProjectFeature::DISABLED)
project1 = create(:project, wiki_access_level: ProjectFeature::DISABLED)
expect(described_class.with_wiki_enabled).to include(project)
expect(described_class.with_wiki_enabled).not_to include(project1)
......@@ -201,7 +201,7 @@ describe Project do
context '#mark_stuck_remote_mirrors_as_failed!' do
it 'fails stuck remote mirrors' do
project = create(:project, :remote_mirror, :repository)
project = create(:project, :repository, :remote_mirror)
project.remote_mirrors.first.update_attributes(
update_status: :started,
......@@ -215,7 +215,7 @@ describe Project do
end
context 'mirror' do
subject { build(:empty_project, mirror: true) }
subject { build(:project, mirror: true) }
it { is_expected.to validate_presence_of(:import_url) }
it { is_expected.to validate_presence_of(:mirror_user) }
......@@ -266,13 +266,13 @@ describe Project do
end
it 'creates mirror data when enabled' do
project2 = create(:empty_project, :mirror, mirror: false)
project2 = create(:project, :mirror, mirror: false)
expect { project2.update_attributes(mirror: true) }.to change { ProjectMirrorData.count }.from(0).to(1)
end
it 'destroys mirror data when disabled' do
project2 = create(:empty_project, :mirror)
project2 = create(:project, :mirror)
expect { project2.update_attributes(mirror: false) }.to change { ProjectMirrorData.count }.from(1).to(0)
end
......@@ -490,7 +490,7 @@ describe Project do
end
describe "#kerberos_url_to_repo" do
let(:project) { create(:empty_project, path: "somewhere") }
let(:project) { create(:project, path: "somewhere") }
it 'returns valid kerberos url for this repo' do
expect(project.kerberos_url_to_repo).to eq("#{Gitlab.config.build_gitlab_kerberos_url}/#{project.namespace.path}/somewhere.git")
......@@ -678,7 +678,7 @@ describe Project do
end
describe 'repository size restrictions' do
let(:project) { build(:empty_project) }
let(:project) { build(:project) }
before do
allow_any_instance_of(ApplicationSetting).to receive(:repository_size_limit).and_return(50)
......@@ -728,7 +728,7 @@ describe Project do
describe '#above_size_limit?' do
let(:project) do
create(:empty_project,
create(:project,
statistics: build(:project_statistics))
end
......@@ -754,7 +754,7 @@ describe Project do
describe '#repository_size_limit column' do
it 'support values up to 8 exabytes' do
project = create(:empty_project)
project = create(:project)
project.update_column(:repository_size_limit, 8.exabytes - 1)
project.reload
......@@ -844,7 +844,7 @@ describe Project do
end
describe '#cache_has_external_wiki' do
let(:project) { create(:empty_project, has_external_wiki: nil) }
let(:project) { create(:project, has_external_wiki: nil) }
it 'stores true if there is any external_wikis' do
services = double(:service, external_wikis: [ExternalWikiService.new])
......@@ -1627,7 +1627,7 @@ describe Project do
describe 'handling import URL' do
context 'when project is a mirror' do
it 'returns the full URL' do
project = create(:empty_project, :mirror, import_url: 'http://user:pass@test.com')
project = create(:project, :mirror, import_url: 'http://user:pass@test.com')
project.import_finish
......@@ -1637,7 +1637,7 @@ describe Project do
context 'when project is not a mirror' do
it 'returns the sanitized URL' do
project = create(:empty_project, import_status: 'started', import_url: 'http://user:pass@test.com')
project = create(:project, import_status: 'started', import_url: 'http://user:pass@test.com')
project.import_finish
......@@ -1819,7 +1819,7 @@ describe Project do
end
context 'with a mirrored project' do
let(:project) { create(:empty_project, :mirror) }
let(:project) { create(:project, :mirror) }
it 'calls RepositoryImportWorker and inserts in front of the mirror scheduler queue' do
allow_any_instance_of(described_class).to receive(:repository_exists?).and_return(false, true)
......@@ -1869,7 +1869,7 @@ describe Project do
end
it 'does not index the repository' do
project = create(:empty_project, :import_started, import_type: :github)
project = create(:project, :import_started, import_type: :github)
expect(ElasticCommitIndexerWorker).not_to receive(:perform_async)
......@@ -1878,7 +1878,7 @@ describe Project do
end
context 'elasticsearch indexing enabled' do
let(:project) { create(:empty_project, :import_started, import_type: :github) }
let(:project) { create(:project, :import_started, import_type: :github) }
before do
stub_application_setting(elasticsearch_indexing: true)
......@@ -2009,7 +2009,7 @@ describe Project do
describe '#updating_mirror?' do
context 'when repository is empty' do
it 'returns false' do
project = create(:empty_project, :mirror, :import_started)
project = create(:project, :mirror, :import_started)
expect(project.updating_mirror?).to be false
end
......@@ -2017,7 +2017,7 @@ describe Project do
context 'when project is not a mirror' do
it 'returns false' do
project = create(:empty_project, :import_started)
project = create(:project, :import_started)
expect(project.updating_mirror?).to be false
end
......@@ -2035,7 +2035,7 @@ describe Project do
describe '#force_import_job!' do
it 'sets next execution timestamp to now and schedules UpdateAllMirrorsWorker' do
timestamp = Time.now
project = create(:empty_project, :mirror)
project = create(:project, :mirror)
project.mirror_data.update_attributes(next_execution_timestamp: timestamp - 3.minutes)
......@@ -2062,7 +2062,7 @@ describe Project do
context 'without mirror' do
it 'returns nil' do
project = create(:empty_project)
project = create(:project)
expect(project.add_import_job).to be_nil
end
......@@ -2070,7 +2070,7 @@ describe Project do
context 'without repository' do
it 'schedules RepositoryImportWorker' 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)
......@@ -2188,8 +2188,8 @@ describe Project do
end
context 'with valid paths' do
let!(:project1) { create(:empty_project) }
let!(:project2) { create(:empty_project) }
let!(:project1) { create(:project) }
let!(:project2) { create(:project) }
it 'returns the projects matching the paths' do
projects = described_class.where_full_path_in([project1.full_path,
......@@ -2208,7 +2208,7 @@ describe Project do
end
describe '#find_path_lock' do
let(:project) { create :empty_project }
let(:project) { create :project }
let(:path_lock) { create :path_lock, project: project }
let(:path) { path_lock.path }
......@@ -2349,13 +2349,13 @@ describe Project do
end
describe '#approver_group_ids=' do
let(:project) { create(:empty_project) }
let(:project) { create(:project) }
it 'create approver_groups' do
group = create :group
group1 = create :group
project = create :empty_project
project = create :project
project.approver_group_ids = "#{group.id}, #{group1.id}"
project.save!
......@@ -2506,7 +2506,7 @@ describe Project do
describe '#create_mirror_data' do
it 'it is called after save' do
project = create(:empty_project)
project = create(:project)
expect(project).to receive(:create_mirror_data)
......
......@@ -9,8 +9,8 @@ describe MergeRequestPolicy do
let(:fork_developer) { create(:user) }
let(:fork_master) { create(:user) }
let(:project) { create(:empty_project, :public) }
let(:fork_project) { create(:empty_project, :public, forked_from_project: project) }
let(:project) { create(:project, :public) }
let(:fork_project) { create(:project, :public, forked_from_project: project) }
let(:merge_request) { create(:merge_request, source_project: project, target_project: project) }
let(:fork_merge_request) { create(:merge_request, author: fork_developer, source_project: fork_project, target_project: project) }
......
......@@ -5,7 +5,7 @@ describe API::Issues do # rubocop:disable RSpec/FilePath
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) }
......
......@@ -208,7 +208,7 @@ describe API::Geo do
describe 'GET /geo/transfers/file/1' do
let!(:secondary_node) { create(:geo_node) }
let(:project) { create(:empty_project) }
let(:project) { create(:project) }
let(:upload) { Upload.find_by(model: project, uploader: 'FileUploader') }
let(:transfer) { Gitlab::Geo::FileTransfer.new(:file, upload) }
let(:req_header) { Gitlab::Geo::TransferRequest.new(transfer.request_data).headers }
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe API::IssueLinks do
let(:user) { create(:user) }
let(:project) { create(:empty_project) }
let(:project) { create(:project) }
let(:issue) { create(:issue, project: project) }
before do
......@@ -60,7 +60,7 @@ describe API::IssueLinks do
context 'given target issue not found' do
it 'returns 404' do
target_project = create(:empty_project, :public)
target_project = create(:project, :public)
post api("/projects/#{project.id}/issues/#{issue.iid}/links", user),
target_project_id: target_project.id, target_issue_iid: 999
......@@ -72,7 +72,7 @@ describe API::IssueLinks do
context 'when user does not have write access to given issue' do
it 'returns 404' do
unauthorized_project = create(:empty_project)
unauthorized_project = create(:project)
target_issue = create(:issue, project: unauthorized_project)
unauthorized_project.add_guest(user)
......@@ -86,7 +86,7 @@ describe API::IssueLinks do
context 'when trying to relate to a confidential issue' do
it 'returns 404' do
project = create(:empty_project, :public)
project = create(:project, :public)
target_issue = create(:issue, :confidential, project: project)
post api("/projects/#{project.id}/issues/#{issue.iid}/links", user),
......@@ -99,7 +99,7 @@ describe API::IssueLinks do
context 'when trying to relate to a private project issue' do
it 'returns 404' do
project = create(:empty_project, :private)
project = create(:project, :private)
target_issue = create(:issue, project: project)
post api("/projects/#{project.id}/issues/#{issue.iid}/links", user),
......@@ -150,7 +150,7 @@ describe API::IssueLinks do
context 'when authenticated' do
context 'when user does not have write access to given issue link' do
it 'returns 404' do
unauthorized_project = create(:empty_project)
unauthorized_project = create(:project)
target_issue = create(:issue, project: unauthorized_project)
issue_link = create(:issue_link, source: issue, target: target_issue)
unauthorized_project.add_guest(user)
......@@ -173,7 +173,7 @@ describe API::IssueLinks do
context 'when trying to delete a link with a private project issue' do
it 'returns 404' do
project = create(:empty_project, :private)
project = create(:project, :private)
target_issue = create(:issue, project: project)
issue_link = create(:issue_link, source: issue, target: target_issue)
......
......@@ -185,7 +185,7 @@ describe API::Members do
context 'project in a group' do
it 'returns a 405 method not allowed error when group membership lock is enabled' do
group_with_membership_locked = create(:group, membership_lock: true)
project = create(:empty_project, group: group_with_membership_locked)
project = create(:project, group: group_with_membership_locked)
project.group.add_owner(master)
post api("/projects/#{project.id}/members", master),
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe API::Variables do
let(:user) { create(:user) }
let(:project) { create(:empty_project) }
let(:project) { create(:project) }
describe 'POST /projects/:id/variables' do
context 'with variable environment scope available' do
......
......@@ -2,7 +2,7 @@ require "spec_helper"
describe "routes to the proper webhooks controller", type: :routing do
context 'with a project context' do
let(:project) { create(:empty_project) }
let(:project) { create(:project) }
let(:project_hook) { create(:project_hook) }
it "routes the test action" do
......
require 'spec_helper'
describe AuditEventService do
let(:project) { create(:empty_project) }
let(:project) { create(:project) }
let(:user) { create(:user) }
let(:project_member) { create(:project_member, user: user) }
let(:service) { described_class.new(user, project, { action: :destroy }) }
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe Boards::DestroyService do
describe '#execute' do
let(:project) { create(:empty_project) }
let(:project) { create(:project) }
let!(:board) { create(:board, project: project) }
subject(:service) { described_class.new(project, double) }
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe Boards::UpdateService do
describe '#execute' do
let(:project) { create(:empty_project) }
let(:project) { create(:project) }
let!(:board) { create(:board, project: project, name: 'Backend') }
it "updates board's name" do
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe Boards::CreateService do
describe '#execute' do
let(:project) { create(:empty_project) }
let(:project) { create(:project) }
context 'With the feature available' do
before do
......
require 'spec_helper'
describe Boards::ListService do
let(:project) { create(:empty_project) }
let(:project) { create(:project) }
let(:service) { described_class.new(project, double) }
before do
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
module Ci
describe RegisterJobService do
let!(:project) { create :empty_project, shared_runners_enabled: false }
let!(:project) { create :project, shared_runners_enabled: false }
let!(:pipeline) { create :ci_empty_pipeline, project: project }
let!(:pending_build) { create :ci_build, pipeline: pipeline }
let(:shared_runner) { create(:ci_runner, :shared) }
......
......@@ -11,7 +11,7 @@ describe Issues::BuildService do # rubocop:disable RSpec/FilePath
context 'with an issue template' do
describe '#execute' do
it 'fills in the template in the description' do
project = build(:empty_project, issues_template: 'Work hard, play hard!')
project = build(:project, issues_template: 'Work hard, play hard!')
service = described_class.new(project, user)
issue = service.execute
......
......@@ -28,7 +28,7 @@ describe MergeRequests::BuildService do # rubocop:disable RSpec/FilePath
context 'project default template configured' do
let(:template) { "I am the template, you fill me in" }
let(:project) { create(:empty_project, merge_requests_template: template) }
let(:project) { create(:project, merge_requests_template: template) }
context 'issuable default templates feature not available' do
before do
......
......@@ -4,7 +4,7 @@ describe QuickActions::InterpretService do # rubocop:disable RSpec/FilePath
let(:user) { create(:user) }
let(:developer) { create(:user) }
let(:developer2) { create(:user) }
let(:project) { create(:empty_project, :public) }
let(:project) { create(:project, :public) }
let(:issue) { create(:issue, project: project) }
let(:service) { described_class.new(project, developer) }
......
require 'spec_helper'
describe WikiPages::CreateService do
let(:project) { create(:empty_project) }
let(:project) { create(:project) }
let(:user) { create(:user) }
let(:opts) do
......
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) }
......
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) }
......
......@@ -42,7 +42,7 @@ describe Geo::FileDownloadService do
end
context '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')) }
let(:upload) { Upload.find_by(model: project, uploader: 'AvatarUploader') }
subject { described_class.new(:avatar, upload.id) }
......@@ -74,7 +74,7 @@ describe Geo::FileDownloadService do
end
context 'with file upload' do
let(:project) { create(:empty_project) }
let(:project) { create(:project) }
let(:upload) { Upload.find_by(model: project, uploader: 'FileUploader') }
subject { described_class.new(:file, upload.id) }
......
......@@ -53,7 +53,7 @@ describe Geo::FileUploadService do
end
context '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')) }
let(:upload) { Upload.find_by(model: project, uploader: 'AvatarUploader') }
let(:params) { { id: upload.id, type: 'avatar' } }
let(:file_transfer) { Gitlab::Geo::FileTransfer.new(:avatar, upload) }
......@@ -101,7 +101,7 @@ describe Geo::FileUploadService do
end
context 'file upload' do
let(:project) { create(:empty_project) }
let(:project) { create(:project) }
let(:upload) { Upload.find_by(model: project, uploader: 'FileUploader') }
let(:params) { { id: upload.id, type: 'file' } }
let(:file_transfer) { Gitlab::Geo::FileTransfer.new(:file, upload) }
......
require 'spec_helper'
describe Geo::RepositoryDeletedEventStore do
let(:project) { create(:empty_project, path: 'bar') }
let(:project) { create(:project, path: 'bar') }
let!(:project_id) { project.id }
let!(:project_name) { project.name }
let!(:repo_path) { project.full_path }
......
require 'spec_helper'
describe Geo::RepositoryRenamedEventStore do
let(:project) { create(:empty_project, path: 'bar') }
let(:project) { create(:project, path: 'bar') }
let(:old_path) { 'foo' }
let(:old_path_with_namespace) { "#{project.namespace.full_path}/foo" }
......
require 'spec_helper'
describe Geo::RepositoryUpdateService do
let(:project) { create(:empty_project) }
let(:project) { create(:project) }
let(:clone_url) { project.ssh_url_to_repo }
subject { described_class.new(project, clone_url) }
......
......@@ -3,7 +3,7 @@ require 'spec_helper'
describe IssueLinks::CreateService do
describe '#execute' do
let(:namespace) { create :namespace }
let(:project) { create :empty_project, namespace: namespace }
let(:project) { create :project, namespace: namespace }
let(:issue) { create :issue, project: project }
let(:user) { create :user }
let(:params) do
......@@ -62,7 +62,7 @@ describe IssueLinks::CreateService do
context 'when there is an issue to relate' do
let(:issue_a) { create :issue, project: project }
let(:another_project) { create :empty_project, namespace: project.namespace }
let(:another_project) { create :project, namespace: project.namespace }
let(:another_project_issue) { create :issue, project: another_project }
let(:issue_a_ref) { issue_a.to_reference }
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe IssueLinks::DestroyService do
describe '#execute' do
let(:project) { create(:empty_project) }
let(:project) { create(:project) }
let(:user) { create(:user) }
subject { described_class.new(issue_link, user).execute }
......@@ -37,7 +37,7 @@ describe IssueLinks::DestroyService do
end
context 'when failing to remove an issue link' do
let(:unauthorized_project) { create(:empty_project) }
let(:unauthorized_project) { create(:project) }
let(:issue_a) { create(:issue, project: project) }
let(:issue_b) { create(:issue, project: unauthorized_project) }
......
......@@ -38,7 +38,7 @@ describe IssueLinks::ListService do
it 'ensures no N+1 queries are made' do
control_count = ActiveRecord::QueryRecorder.new { subject }.count
project = create :empty_project, :public
project = create :project, :public
issue_x = create :issue, project: project
issue_y = create :issue, project: project
issue_z = create :issue, project: project
......@@ -76,7 +76,7 @@ describe IssueLinks::ListService do
end
context 'referencing a public project issue' do
let(:public_project) { create :empty_project, :public }
let(:public_project) { create :project, :public }
let(:issue_b) { create :issue, project: public_project }
let!(:issue_link) do
......@@ -158,7 +158,7 @@ describe IssueLinks::ListService do
context 'user can admin related issues just on target project' do
let(:user_role) { :guest }
let(:target_project) { create :empty_project }
let(:target_project) { create :project }
let(:referenced_issue) { create :issue, project: target_project }
it 'returns no destroy relation path' do
......@@ -170,7 +170,7 @@ describe IssueLinks::ListService do
context 'user can admin related issues just on source project' do
let(:user_role) { :developer }
let(:target_project) { create :empty_project }
let(:target_project) { create :project }
let(:referenced_issue) { create :issue, project: target_project }
it 'returns no destroy relation path' do
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe Issues::ExportCsvService do
let(:user) { create(:user) }
let(:project) { create(:empty_project, :public) }
let(:project) { create(:project, :public) }
let!(:issue) { create(:issue, project: project, author: user) }
let(:subject) { described_class.new(Issue.all) }
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe PathLocks::LockService do
let(:current_user) { create(:user) }
let(:project) { create(:empty_project) }
let(:project) { create(:project) }
let(:path) { 'app/models' }
it 'locks path' do
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe Projects::SlackApplicationInstallService do
let!(:user) { create(:user) }
let!(:project) { create(:empty_project) }
let!(:project) { create(:project) }
def service(params = {})
Projects::SlackApplicationInstallService.new(project, user, params)
......
......@@ -124,7 +124,7 @@ describe Projects::UpdateMirrorService do
end
describe "when is no mirror" do
let(:project) { build_stubbed(:empty_project) }
let(:project) { build_stubbed(:project) }
it "success" do
expect(project.mirror?).to eq(false)
......
......@@ -171,7 +171,7 @@ describe Projects::UpdateService, '#execute' do
context 'repository_size_limit assignment as Bytes' do
let(:admin_user) { create(:user, admin: true) }
let(:project) { create(:empty_project, repository_size_limit: 0) }
let(:project) { create(:project, repository_size_limit: 0) }
context 'when param present' do
let(:opts) { { repository_size_limit: '100' } }
......
require 'spec_helper'
describe SlashCommands::GlobalSlackHandler do
let(:project) { create(:empty_project) }
let(:project) { create(:project) }
let(:user) { create(:user) }
let(:verification_token) { '123' }
......
......@@ -3,7 +3,7 @@ require 'spec_helper'
describe UpdateBuildMinutesService do
context '#perform' do
let(:namespace) { create(:namespace, shared_runners_minutes_limit: 100) }
let(:project) { create(:empty_project, namespace: namespace) }
let(:project) { create(:project, namespace: namespace) }
let(:pipeline) { create(:ci_pipeline, project: project) }
let(:build) do
create(:ci_build, :success,
......
......@@ -177,7 +177,7 @@ describe Users::DestroyService do
end
it 'updates the mirror_user to one of the group owners' do
project = create(:empty_project, namespace_id: group.id, creator: group_owner, mirror_user: mirror_user)
project = create(:project, namespace_id: group.id, creator: group_owner, mirror_user: mirror_user)
service.execute(mirror_user)
expect(project.reload.mirror_user).to eq group_owner
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'shared/issuable/_approvals.html.haml' do
let(:user) { create(:user) }
let(:project) { build(:empty_project) }
let(:project) { build(:project) }
let(:merge_request) { create(:merge_request, source_project: project, target_project: project) }
let(:form) { double('form') }
......
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