diff options
author | Robert Speicher <rspeicher@gmail.com> | 2017-08-02 15:55:11 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2017-08-02 17:47:31 -0400 |
commit | 72a7b30c9f363063449b28aa9efc3a26a1752f9f (patch) | |
tree | 173a716da52260e57a73c4a6d739fe055898d556 /spec/models | |
parent | e2c3dca371f8dca8814a5924fe8ed271f0ec6399 (diff) | |
download | gitlab-ce-rs-empty_project-default.tar.gz |
Change all `:empty_project` to `:project`rs-empty_project-default
Diffstat (limited to 'spec/models')
71 files changed, 356 insertions, 356 deletions
diff --git a/spec/models/ability_spec.rb b/spec/models/ability_spec.rb index aa019288700..71aa51e1857 100644 --- a/spec/models/ability_spec.rb +++ b/spec/models/ability_spec.rb @@ -8,7 +8,7 @@ describe Ability do end describe '.can_edit_note?' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:note) { create(:note_on_issue, project: project) } context 'using an anonymous user' do @@ -66,7 +66,7 @@ describe Ability do describe '.users_that_can_read_project' do context 'using a public project' do it 'returns all the users' do - project = create(:empty_project, :public) + project = create(:project, :public) user = build(:user) expect(described_class.users_that_can_read_project([user], project)) @@ -75,7 +75,7 @@ describe Ability do end context 'using an internal project' do - let(:project) { create(:empty_project, :internal) } + let(:project) { create(:project, :internal) } it 'returns users that are administrators' do user = build(:user, admin: true) @@ -126,7 +126,7 @@ describe Ability do end context 'using a private project' do - let(:project) { create(:empty_project, :private) } + let(:project) { create(:project, :private) } it 'returns users that are administrators' do user = build(:user, admin: true) @@ -253,7 +253,7 @@ describe Ability do end describe '.project_disabled_features_rules' do - let(:project) { create(:empty_project, :wiki_disabled) } + let(:project) { create(:project, :wiki_disabled) } subject { described_class.policy_for(project.owner, project) } diff --git a/spec/models/blob_spec.rb b/spec/models/blob_spec.rb index e1193e0d19a..47342f98283 100644 --- a/spec/models/blob_spec.rb +++ b/spec/models/blob_spec.rb @@ -4,7 +4,7 @@ require 'rails_helper' describe Blob do include FakeBlobHelpers - let(:project) { build(:empty_project, lfs_enabled: true) } + let(:project) { build(:project, lfs_enabled: true) } before do allow(Gitlab.config.lfs).to receive(:enabled).and_return(true) diff --git a/spec/models/blob_viewer/base_spec.rb b/spec/models/blob_viewer/base_spec.rb index e3640097dff..7ba28f72215 100644 --- a/spec/models/blob_viewer/base_spec.rb +++ b/spec/models/blob_viewer/base_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe BlobViewer::Base do include FakeBlobHelpers - let(:project) { build(:empty_project) } + let(:project) { build(:project) } let(:viewer_class) do Class.new(described_class) do diff --git a/spec/models/blob_viewer/composer_json_spec.rb b/spec/models/blob_viewer/composer_json_spec.rb index 35e7e1805d4..85b0d9668a0 100644 --- a/spec/models/blob_viewer/composer_json_spec.rb +++ b/spec/models/blob_viewer/composer_json_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe BlobViewer::ComposerJson do include FakeBlobHelpers - let(:project) { build_stubbed(:empty_project) } + let(:project) { build_stubbed(:project) } let(:data) do <<-SPEC.strip_heredoc { diff --git a/spec/models/blob_viewer/gemspec_spec.rb b/spec/models/blob_viewer/gemspec_spec.rb index 5406ff552f8..d8c4490637f 100644 --- a/spec/models/blob_viewer/gemspec_spec.rb +++ b/spec/models/blob_viewer/gemspec_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe BlobViewer::Gemspec do include FakeBlobHelpers - let(:project) { build_stubbed(:empty_project) } + let(:project) { build_stubbed(:project) } let(:data) do <<-SPEC.strip_heredoc Gem::Specification.new do |s| diff --git a/spec/models/blob_viewer/gitlab_ci_yml_spec.rb b/spec/models/blob_viewer/gitlab_ci_yml_spec.rb index 344fcdeb9b6..bed364a8c14 100644 --- a/spec/models/blob_viewer/gitlab_ci_yml_spec.rb +++ b/spec/models/blob_viewer/gitlab_ci_yml_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe BlobViewer::GitlabCiYml do include FakeBlobHelpers - let(:project) { build_stubbed(:empty_project) } + let(:project) { build_stubbed(:project) } let(:data) { File.read(Rails.root.join('spec/support/gitlab_stubs/gitlab_ci.yml')) } let(:blob) { fake_blob(path: '.gitlab-ci.yml', data: data) } subject { described_class.new(blob) } diff --git a/spec/models/blob_viewer/package_json_spec.rb b/spec/models/blob_viewer/package_json_spec.rb index 976c2ed3639..0f8330e91c1 100644 --- a/spec/models/blob_viewer/package_json_spec.rb +++ b/spec/models/blob_viewer/package_json_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe BlobViewer::PackageJson do include FakeBlobHelpers - let(:project) { build_stubbed(:empty_project) } + let(:project) { build_stubbed(:project) } let(:data) do <<-SPEC.strip_heredoc { diff --git a/spec/models/blob_viewer/podspec_json_spec.rb b/spec/models/blob_viewer/podspec_json_spec.rb index b98360ea7b7..9a23877b23f 100644 --- a/spec/models/blob_viewer/podspec_json_spec.rb +++ b/spec/models/blob_viewer/podspec_json_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe BlobViewer::PodspecJson do include FakeBlobHelpers - let(:project) { build_stubbed(:empty_project) } + let(:project) { build_stubbed(:project) } let(:data) do <<-SPEC.strip_heredoc { diff --git a/spec/models/blob_viewer/podspec_spec.rb b/spec/models/blob_viewer/podspec_spec.rb index ad2bbe034ea..02d06ea24d6 100644 --- a/spec/models/blob_viewer/podspec_spec.rb +++ b/spec/models/blob_viewer/podspec_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe BlobViewer::Podspec do include FakeBlobHelpers - let(:project) { build_stubbed(:empty_project) } + let(:project) { build_stubbed(:project) } let(:data) do <<-SPEC.strip_heredoc Pod::Spec.new do |spec| diff --git a/spec/models/blob_viewer/route_map_spec.rb b/spec/models/blob_viewer/route_map_spec.rb index 12b6519a344..c13662427b0 100644 --- a/spec/models/blob_viewer/route_map_spec.rb +++ b/spec/models/blob_viewer/route_map_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe BlobViewer::RouteMap do include FakeBlobHelpers - let(:project) { build_stubbed(:empty_project) } + let(:project) { build_stubbed(:project) } let(:data) do <<-MAP.strip_heredoc # Team data diff --git a/spec/models/blob_viewer/server_side_spec.rb b/spec/models/blob_viewer/server_side_spec.rb index 2639eec9e84..63790486200 100644 --- a/spec/models/blob_viewer/server_side_spec.rb +++ b/spec/models/blob_viewer/server_side_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe BlobViewer::ServerSide do include FakeBlobHelpers - let(:project) { build(:empty_project) } + let(:project) { build(:project) } let(:viewer_class) do Class.new(BlobViewer::Base) do @@ -25,7 +25,7 @@ describe BlobViewer::ServerSide do describe '#render_error' do context 'when the blob is stored externally' do - let(:project) { build(:empty_project, lfs_enabled: true) } + let(:project) { build(:project, lfs_enabled: true) } let(:blob) { fake_blob(path: 'file.pdf', lfs: true) } diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb index b0efa689a07..f63ff19c2fc 100644 --- a/spec/models/ci/pipeline_spec.rb +++ b/spec/models/ci/pipeline_spec.rb @@ -4,7 +4,7 @@ describe Ci::Pipeline do include EmailHelpers let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:pipeline) do create(:ci_empty_pipeline, status: :created, project: project) @@ -93,7 +93,7 @@ describe Ci::Pipeline do end describe "coverage" do - let(:project) { create(:empty_project, build_coverage_regex: "/.*/") } + let(:project) { create(:project, build_coverage_regex: "/.*/") } let(:pipeline) { create(:ci_empty_pipeline, project: project) } it "calculates average when there are two builds with coverage" do @@ -1147,7 +1147,7 @@ describe Ci::Pipeline do end describe "#merge_requests" do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:pipeline) { create(:ci_empty_pipeline, status: 'created', project: project, ref: 'master', sha: 'a288a022a53a5a944fae87bcec6efc87b7061808') } it "returns merge requests whose `diff_head_sha` matches the pipeline's SHA" do @@ -1172,7 +1172,7 @@ describe Ci::Pipeline do end describe "#all_merge_requests" do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:pipeline) { create(:ci_empty_pipeline, status: 'created', project: project, ref: 'master') } it "returns all merge requests having the same source branch" do diff --git a/spec/models/ci/runner_spec.rb b/spec/models/ci/runner_spec.rb index 8d12a9c09ca..48f878bbee6 100644 --- a/spec/models/ci/runner_spec.rb +++ b/spec/models/ci/runner_spec.rb @@ -37,7 +37,7 @@ describe Ci::Runner do end describe '#assign_to' do - let!(:project) { FactoryGirl.create :empty_project } + let!(:project) { FactoryGirl.create :project } let!(:shared_runner) { FactoryGirl.create(:ci_runner, :shared) } before do @@ -339,8 +339,8 @@ describe Ci::Runner do describe '.assignable_for' do let(:runner) { create(:ci_runner) } - let(:project) { create(:empty_project) } - let(:another_project) { create(:empty_project) } + let(:project) { create(:project) } + let(:another_project) { create(:project) } before do project.runners << runner @@ -400,8 +400,8 @@ describe Ci::Runner do describe "belongs_to_one_project?" do it "returns false if there are two projects runner assigned to" do runner = FactoryGirl.create(:ci_runner) - project = FactoryGirl.create(:empty_project) - project1 = FactoryGirl.create(:empty_project) + project = FactoryGirl.create(:project) + project1 = FactoryGirl.create(:project) project.runners << runner project1.runners << runner @@ -410,7 +410,7 @@ describe Ci::Runner do it "returns true" do runner = FactoryGirl.create(:ci_runner) - project = FactoryGirl.create(:empty_project) + project = FactoryGirl.create(:project) project.runners << runner expect(runner.belongs_to_one_project?).to be_truthy diff --git a/spec/models/ci/trigger_spec.rb b/spec/models/ci/trigger_spec.rb index de51f4879fd..bd9c837402f 100644 --- a/spec/models/ci/trigger_spec.rb +++ b/spec/models/ci/trigger_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Ci::Trigger do - let(:project) { create :empty_project } + let(:project) { create :project } describe 'associations' do it { is_expected.to belong_to(:project) } diff --git a/spec/models/commit_range_spec.rb b/spec/models/commit_range_spec.rb index 07e10b44938..38829773599 100644 --- a/spec/models/commit_range_spec.rb +++ b/spec/models/commit_range_spec.rb @@ -45,7 +45,7 @@ describe CommitRange do end describe '#to_reference' do - let(:cross) { create(:empty_project, namespace: project.namespace) } + let(:cross) { create(:project, namespace: project.namespace) } it 'returns a String reference to the object' do expect(range.to_reference).to eq "#{full_sha_from}...#{full_sha_to}" @@ -61,7 +61,7 @@ describe CommitRange do end describe '#reference_link_text' do - let(:cross) { create(:empty_project, namespace: project.namespace) } + let(:cross) { create(:project, namespace: project.namespace) } it 'returns a String reference to the object' do expect(range.reference_link_text).to eq "#{sha_from}...#{sha_to}" diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb index 595c54890ab..08693b5da33 100644 --- a/spec/models/commit_spec.rb +++ b/spec/models/commit_spec.rb @@ -151,7 +151,7 @@ eos describe '#closes_issues' do let(:issue) { create :issue, project: project } - let(:other_project) { create(:empty_project, :public) } + let(:other_project) { create(:project, :public) } let(:other_issue) { create :issue, project: other_project } let(:commiter) { create :user } diff --git a/spec/models/concerns/access_requestable_spec.rb b/spec/models/concerns/access_requestable_spec.rb index 97b7e48bb3c..04d6cfa2c02 100644 --- a/spec/models/concerns/access_requestable_spec.rb +++ b/spec/models/concerns/access_requestable_spec.rb @@ -24,14 +24,14 @@ describe AccessRequestable do describe 'Project' do describe '#request_access' do - let(:project) { create(:empty_project, :public, :access_requestable) } + let(:project) { create(:project, :public, :access_requestable) } let(:user) { create(:user) } it { expect(project.request_access(user)).to be_a(ProjectMember) } end describe '#access_requested?' do - let(:project) { create(:empty_project, :public, :access_requestable) } + let(:project) { create(:project, :public, :access_requestable) } let(:user) { create(:user) } before do diff --git a/spec/models/concerns/issuable_spec.rb b/spec/models/concerns/issuable_spec.rb index 505039c9d88..0137f71be8f 100644 --- a/spec/models/concerns/issuable_spec.rb +++ b/spec/models/concerns/issuable_spec.rb @@ -155,7 +155,7 @@ describe Issuable do end describe "#sort" do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } context "by milestone due date" do # Correct order is: @@ -296,7 +296,7 @@ describe Issuable do end describe '#labels_array' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:bug) { create(:label, project: project, title: 'bug') } let(:issue) { create(:issue, project: project) } @@ -310,7 +310,7 @@ describe Issuable do end describe '#user_notes_count' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:issue1) { create(:issue, project: project) } let(:issue2) { create(:issue, project: project) } @@ -340,7 +340,7 @@ describe Issuable do end describe '.order_due_date_and_labels_priority' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } def create_issue(milestone, labels) create(:labeled_issue, milestone: milestone, labels: labels, project: project) @@ -394,7 +394,7 @@ describe Issuable do end describe ".with_label" do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:bug) { create(:label, project: project, title: 'bug') } let(:feature) { create(:label, project: project, title: 'feature') } let(:enhancement) { create(:label, project: project, title: 'enhancement') } diff --git a/spec/models/concerns/mentionable_spec.rb b/spec/models/concerns/mentionable_spec.rb index 1ad811736af..8b545aec7f5 100644 --- a/spec/models/concerns/mentionable_spec.rb +++ b/spec/models/concerns/mentionable_spec.rb @@ -13,7 +13,7 @@ describe Mentionable do end describe 'references' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:mentionable) { Example.new } it 'excludes JIRA references' do @@ -48,10 +48,10 @@ describe Issue, "Mentionable" do describe '#referenced_mentionables' do context 'with an issue on a private project' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:issue) { create(:issue, project: project) } let(:public_issue) { create(:issue, project: project) } - let(:private_project) { create(:empty_project, :private) } + let(:private_project) { create(:project, :private) } let(:private_issue) { create(:issue, project: private_project) } let(:user) { create(:user) } @@ -102,7 +102,7 @@ describe Issue, "Mentionable" do end describe '#create_new_cross_references!' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:author) { create(:author) } let(:issues) { create_list(:issue, 2, project: project, author: author) } @@ -204,7 +204,7 @@ describe Commit, 'Mentionable' do end context 'with external issue tracker' do - let(:project) { create(:jira_project) } + let(:project) { create(:jira_project, :repository) } it 'is true if external issues referenced' do allow(commit.raw).to receive(:message).and_return 'JIRA-123' diff --git a/spec/models/concerns/milestoneish_spec.rb b/spec/models/concerns/milestoneish_spec.rb index cefe7fb6fea..66353935427 100644 --- a/spec/models/concerns/milestoneish_spec.rb +++ b/spec/models/concerns/milestoneish_spec.rb @@ -7,7 +7,7 @@ describe Milestone, 'Milestoneish' do let(:member) { create(:user) } let(:guest) { create(:user) } let(:admin) { create(:admin) } - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:milestone) { create(:milestone, project: project) } let!(:issue) { create(:issue, project: project, milestone: milestone) } let!(:security_issue_1) { create(:issue, :confidential, project: project, author: author, milestone: milestone) } diff --git a/spec/models/concerns/participable_spec.rb b/spec/models/concerns/participable_spec.rb index 6c4b5a9e9d6..431f1482615 100644 --- a/spec/models/concerns/participable_spec.rb +++ b/spec/models/concerns/participable_spec.rb @@ -24,7 +24,7 @@ describe Participable do user1 = build(:user) user2 = build(:user) user3 = build(:user) - project = build(:empty_project, :public) + project = build(:project, :public) instance = model.new expect(instance).to receive(:foo).and_return(user2) @@ -57,7 +57,7 @@ describe Participable do other = other_model.new user1 = build(:user) user2 = build(:user) - project = build(:empty_project, :public) + project = build(:project, :public) expect(instance).to receive(:foo).and_return(other) expect(other).to receive(:bar).and_return(user2) @@ -69,7 +69,7 @@ describe Participable do context 'when using a Proc as an attribute' do it 'calls the supplied Proc' do user1 = build(:user) - project = build(:empty_project, :public) + project = build(:project, :public) user_arg = nil ext_arg = nil diff --git a/spec/models/concerns/project_features_compatibility_spec.rb b/spec/models/concerns/project_features_compatibility_spec.rb index 6cf5877424d..9041690023f 100644 --- a/spec/models/concerns/project_features_compatibility_spec.rb +++ b/spec/models/concerns/project_features_compatibility_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe ProjectFeaturesCompatibility do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:features) { %w(issues wiki builds merge_requests snippets) } # We had issues_enabled, snippets_enabled, builds_enabled, merge_requests_enabled and issues_enabled fields on projects table diff --git a/spec/models/concerns/relative_positioning_spec.rb b/spec/models/concerns/relative_positioning_spec.rb index 494e6f1b6f6..729056b6abc 100644 --- a/spec/models/concerns/relative_positioning_spec.rb +++ b/spec/models/concerns/relative_positioning_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe RelativePositioning do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:issue) { create(:issue, project: project) } let(:issue1) { create(:issue, project: project) } let(:new_issue) { create(:issue, project: project) } diff --git a/spec/models/concerns/routable_spec.rb b/spec/models/concerns/routable_spec.rb index 866a835d62a..b463d12e448 100644 --- a/spec/models/concerns/routable_spec.rb +++ b/spec/models/concerns/routable_spec.rb @@ -27,7 +27,7 @@ describe Group, 'Routable' do it 'ensure route path uniqueness across different objects' do create(:group, parent: group, path: 'xyz') - duplicate = build(:empty_project, namespace: group, path: 'xyz') + duplicate = build(:project, namespace: group, path: 'xyz') expect { duplicate.save! }.to raise_error(ActiveRecord::RecordInvalid, 'Validation failed: Route path has already been taken, Route is invalid') end @@ -156,13 +156,13 @@ end describe Project, 'Routable' do describe '#full_path' do - let(:project) { build_stubbed(:empty_project) } + let(:project) { build_stubbed(:project) } it { expect(project.full_path).to eq "#{project.namespace.full_path}/#{project.path}" } end describe '#full_name' do - let(:project) { build_stubbed(:empty_project) } + let(:project) { build_stubbed(:project) } it { expect(project.full_name).to eq "#{project.namespace.human_name} / #{project.name}" } end diff --git a/spec/models/concerns/subscribable_spec.rb b/spec/models/concerns/subscribable_spec.rb index 58f5c164116..28ff8158e0e 100644 --- a/spec/models/concerns/subscribable_spec.rb +++ b/spec/models/concerns/subscribable_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Subscribable, 'Subscribable' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:resource) { create(:issue, project: project) } let(:user_1) { create(:user) } diff --git a/spec/models/deploy_keys_project_spec.rb b/spec/models/deploy_keys_project_spec.rb index f10b65ba9d8..0345fefb254 100644 --- a/spec/models/deploy_keys_project_spec.rb +++ b/spec/models/deploy_keys_project_spec.rb @@ -12,7 +12,7 @@ describe DeployKeysProject do end describe "Destroying" do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } subject { create(:deploy_keys_project, project: project) } let(:deploy_key) { subject.deploy_key } @@ -39,7 +39,7 @@ describe DeployKeysProject do end context "when the deploy key is used by more than one project" do - let!(:other_project) { create(:empty_project) } + let!(:other_project) { create(:project) } before do other_project.deploy_keys << deploy_key diff --git a/spec/models/environment_spec.rb b/spec/models/environment_spec.rb index 9a35213c98d..ea8512a5eae 100644 --- a/spec/models/environment_spec.rb +++ b/spec/models/environment_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Environment do - set(:project) { create(:empty_project) } + set(:project) { create(:project) } subject(:environment) { create(:environment, project: project) } it { is_expected.to belong_to(:project) } diff --git a/spec/models/event_spec.rb b/spec/models/event_spec.rb index 4a4b84c9566..d86bf1a90a9 100644 --- a/spec/models/event_spec.rb +++ b/spec/models/event_spec.rb @@ -15,7 +15,7 @@ describe Event do end describe 'Callbacks' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } describe 'after_create :reset_project_activity' do it 'calls the reset_project_activity method' do @@ -53,7 +53,7 @@ describe Event do end describe "Push event" do - let(:project) { create(:empty_project, :private) } + let(:project) { create(:project, :private) } let(:user) { project.owner } let(:event) { create_push_event(project, user) } @@ -111,7 +111,7 @@ describe Event do end describe '#visible_to_user?' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:non_member) { create(:user) } let(:member) { create(:user) } let(:guest) { create(:user) } @@ -143,7 +143,7 @@ describe Event do end context 'private project' do - let(:project) { create(:empty_project, :private) } + let(:project) { create(:project, :private) } it do aggregate_failures do @@ -213,7 +213,7 @@ describe Event do end context 'merge request diff note event' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:merge_request) { create(:merge_request, source_project: project, author: author, assignee: assignee) } let(:note_on_merge_request) { create(:legacy_diff_note_on_merge_request, noteable: merge_request, project: project) } let(:target) { note_on_merge_request } @@ -228,7 +228,7 @@ describe Event do end context 'private project' do - let(:project) { create(:empty_project, :private) } + let(:project) { create(:project, :private) } it do expect(event.visible_to_user?(non_member)).to eq false @@ -260,7 +260,7 @@ describe Event do end describe '#reset_project_activity' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } context 'when a project was updated less than 1 hour ago' do it 'does not update the project' do diff --git a/spec/models/generic_commit_status_spec.rb b/spec/models/generic_commit_status_spec.rb index aedc74deb78..7f1909710d8 100644 --- a/spec/models/generic_commit_status_spec.rb +++ b/spec/models/generic_commit_status_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe GenericCommitStatus do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:pipeline) { create(:ci_pipeline, project: project) } let(:external_url) { 'http://example.gitlab.com/status' } diff --git a/spec/models/global_milestone_spec.rb b/spec/models/global_milestone_spec.rb index 5584a1a5a31..ab58f5c5021 100644 --- a/spec/models/global_milestone_spec.rb +++ b/spec/models/global_milestone_spec.rb @@ -4,9 +4,9 @@ describe GlobalMilestone do let(:user) { create(:user) } let(:user2) { create(:user) } let(:group) { create(:group) } - let(:project1) { create(:empty_project, group: group) } - let(:project2) { create(:empty_project, path: 'gitlab-ci', group: group) } - let(:project3) { create(:empty_project, path: 'cookbook-gitlab', group: group) } + let(:project1) { create(:project, group: group) } + let(:project2) { create(:project, path: 'gitlab-ci', group: group) } + let(:project3) { create(:project, path: 'cookbook-gitlab', group: group) } describe '.build_collection' do let(:milestone1_due_date) { 2.weeks.from_now.to_date } diff --git a/spec/models/group_label_spec.rb b/spec/models/group_label_spec.rb index f7828059295..d0fc1eaa3ec 100644 --- a/spec/models/group_label_spec.rb +++ b/spec/models/group_label_spec.rb @@ -39,8 +39,8 @@ describe GroupLabel do context 'cross-project' do let(:namespace) { build_stubbed(:namespace) } - let(:source_project) { build_stubbed(:empty_project, name: 'project-1', namespace: namespace) } - let(:target_project) { build_stubbed(:empty_project, name: 'project-2', namespace: namespace) } + let(:source_project) { build_stubbed(:project, name: 'project-1', namespace: namespace) } + let(:target_project) { build_stubbed(:project, name: 'project-2', namespace: namespace) } it 'returns a String reference to the object' do expect(label.to_reference(source_project, target_project: target_project)).to eq %(project-1~#{label.id}) diff --git a/spec/models/group_milestone_spec.rb b/spec/models/group_milestone_spec.rb index ac76c927c39..b60676afc91 100644 --- a/spec/models/group_milestone_spec.rb +++ b/spec/models/group_milestone_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe GroupMilestone do let(:group) { create(:group) } - let(:project) { create(:empty_project, group: group) } + let(:project) { create(:project, group: group) } let(:project_milestone) do create(:milestone, title: "Milestone v1.2", project: project) end diff --git a/spec/models/group_spec.rb b/spec/models/group_spec.rb index 112bd605a64..c5bfae47606 100644 --- a/spec/models/group_spec.rb +++ b/spec/models/group_spec.rb @@ -425,7 +425,7 @@ describe Group do end describe '#secret_variables_for' do - let(:project) { create(:empty_project, group: group) } + let(:project) { create(:project, group: group) } let!(:secret_variable) do create(:ci_group_variable, value: 'secret', group: group) diff --git a/spec/models/guest_spec.rb b/spec/models/guest_spec.rb index 0e9b94aac97..2afdd6751a4 100644 --- a/spec/models/guest_spec.rb +++ b/spec/models/guest_spec.rb @@ -1,9 +1,9 @@ require 'spec_helper' describe Guest do - let(:public_project) { build_stubbed(:empty_project, :public) } - let(:private_project) { build_stubbed(:empty_project, :private) } - let(:internal_project) { build_stubbed(:empty_project, :internal) } + let(:public_project) { build_stubbed(:project, :public) } + let(:private_project) { build_stubbed(:project, :private) } + let(:internal_project) { build_stubbed(:project, :internal) } describe '.can_pull?' do context 'when project is private' do diff --git a/spec/models/hooks/system_hook_spec.rb b/spec/models/hooks/system_hook_spec.rb index eadc232a989..431e3db9f00 100644 --- a/spec/models/hooks/system_hook_spec.rb +++ b/spec/models/hooks/system_hook_spec.rb @@ -16,7 +16,7 @@ describe SystemHook do describe "execute" do let(:system_hook) { create(:system_hook) } let(:user) { create(:user) } - let(:project) { create(:empty_project, namespace: user.namespace) } + let(:project) { create(:project, namespace: user.namespace) } let(:group) { create(:group) } let(:params) do { name: 'John Doe', username: 'jduser', email: 'jg@example.com', password: 'mydummypass' } diff --git a/spec/models/issue/metrics_spec.rb b/spec/models/issue/metrics_spec.rb index 6ceff7d24d4..1bf0ecb98ad 100644 --- a/spec/models/issue/metrics_spec.rb +++ b/spec/models/issue/metrics_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Issue::Metrics do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } subject { create(:issue, project: project) } diff --git a/spec/models/issue_collection_spec.rb b/spec/models/issue_collection_spec.rb index 04d23d4c4fd..34d98a3c975 100644 --- a/spec/models/issue_collection_spec.rb +++ b/spec/models/issue_collection_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe IssueCollection do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:issue1) { create(:issue, project: project) } let(:issue2) { create(:issue, project: project) } let(:collection) { described_class.new([issue1, issue2]) } diff --git a/spec/models/issue_spec.rb b/spec/models/issue_spec.rb index eaf06668327..fa22eee3dea 100644 --- a/spec/models/issue_spec.rb +++ b/spec/models/issue_spec.rb @@ -24,7 +24,7 @@ describe Issue do end describe '#order_by_position_and_priority' do - let(:project) { create :empty_project } + let(:project) { create :project } let(:p1) { create(:label, title: 'P1', project: project, priority: 1) } let(:p2) { create(:label, title: 'P2', project: project, priority: 2) } let!(:issue1) { create(:labeled_issue, project: project, labels: [p1]) } @@ -74,7 +74,7 @@ describe Issue do describe '#to_reference' do let(:namespace) { build(:namespace, path: 'sample-namespace') } - let(:project) { build(:empty_project, name: 'sample-project', namespace: namespace) } + let(:project) { build(:project, name: 'sample-project', namespace: namespace) } let(:issue) { build(:issue, iid: 1, project: project) } let(:group) { create(:group, name: 'Group', path: 'sample-group') } @@ -99,7 +99,7 @@ describe Issue do end context 'when cross namespace project argument' do - let(:another_namespace_project) { create(:empty_project, name: 'another-project') } + let(:another_namespace_project) { create(:project, name: 'another-project') } it 'returns complete path to the issue' do expect(issue.to_reference(another_namespace_project)).to eq 'sample-namespace/sample-project#1' @@ -107,12 +107,12 @@ describe Issue do end it 'supports a cross-project reference' do - another_project = build(:empty_project, name: 'another-project', namespace: project.namespace) + another_project = build(:project, name: 'another-project', namespace: project.namespace) expect(issue.to_reference(another_project)).to eq "sample-project#1" end context 'when same namespace / cross-project argument' do - let(:another_project) { create(:empty_project, namespace: namespace) } + let(:another_project) { create(:project, namespace: namespace) } it 'returns path to the issue with the project name' do expect(issue.to_reference(another_project)).to eq 'sample-project#1' @@ -121,7 +121,7 @@ describe Issue do context 'when different namespace / cross-project argument' do let(:another_namespace) { create(:namespace, path: 'another-namespace') } - let(:another_project) { create(:empty_project, path: 'another-project', namespace: another_namespace) } + let(:another_project) { create(:project, path: 'another-project', namespace: another_namespace) } it 'returns full path to the issue' do expect(issue.to_reference(another_project)).to eq 'sample-namespace/sample-project#1' @@ -209,7 +209,7 @@ describe Issue do describe '#referenced_merge_requests' do it 'returns the referenced merge requests' do - project = create(:empty_project, :public) + project = create(:project, :public) mr1 = create(:merge_request, source_project: project, @@ -242,7 +242,7 @@ describe Issue do end context 'user is reporter in project issue belongs to' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:issue) { create(:issue, project: project) } before do @@ -258,7 +258,7 @@ describe Issue do context 'checking destination project also' do subject { issue.can_move?(user, to_project) } - let(:to_project) { create(:empty_project) } + let(:to_project) { create(:project) } context 'destination project allowed' do before do @@ -380,7 +380,7 @@ describe Issue do describe '#participants' do context 'using a public project' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:issue) { create(:issue, project: project) } let!(:note1) do @@ -402,7 +402,7 @@ describe Issue do context 'using a private project' do it 'does not include mentioned users that do not have access to the project' do - project = create(:empty_project) + project = create(:project) user = create(:user) issue = create(:issue, project: project) @@ -420,7 +420,7 @@ describe Issue do it 'updates when assignees change' do user1 = create(:user) user2 = create(:user) - project = create(:empty_project) + project = create(:project) issue = create(:issue, assignees: [user1], project: project) project.add_developer(user1) project.add_developer(user2) @@ -490,7 +490,7 @@ describe Issue do let(:user) { create(:user) } context 'using a public project' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } it 'returns true for a regular issue' do issue = build(:issue, project: project) @@ -506,7 +506,7 @@ describe Issue do end context 'using an internal project' do - let(:project) { create(:empty_project, :internal) } + let(:project) { create(:project, :internal) } context 'using an internal user' do it 'returns true for a regular issue' do @@ -542,7 +542,7 @@ describe Issue do end context 'using a private project' do - let(:project) { create(:empty_project, :private) } + let(:project) { create(:project, :private) } it 'returns false for a regular issue' do issue = build(:issue, project: project) @@ -578,7 +578,7 @@ describe Issue do context 'with a regular user that is a team member' do let(:user) { create(:user) } - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } context 'using a public project' do before do @@ -599,7 +599,7 @@ describe Issue do end context 'using an internal project' do - let(:project) { create(:empty_project, :internal) } + let(:project) { create(:project, :internal) } before do project.team << [user, Gitlab::Access::DEVELOPER] @@ -619,7 +619,7 @@ describe Issue do end context 'using a private project' do - let(:project) { create(:empty_project, :private) } + let(:project) { create(:project, :private) } before do project.team << [user, Gitlab::Access::DEVELOPER] @@ -640,7 +640,7 @@ describe Issue do end context 'with an admin user' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:admin) } it 'returns true for a regular issue' do @@ -659,7 +659,7 @@ describe Issue do describe '#publicly_visible?' do context 'using a public project' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } it 'returns true for a regular issue' do issue = build(:issue, project: project) @@ -675,7 +675,7 @@ describe Issue do end context 'using an internal project' do - let(:project) { create(:empty_project, :internal) } + let(:project) { create(:project, :internal) } it 'returns false for a regular issue' do issue = build(:issue, project: project) @@ -691,7 +691,7 @@ describe Issue do end context 'using a private project' do - let(:project) { create(:empty_project, :private) } + let(:project) { create(:project, :private) } it 'returns false for a regular issue' do issue = build(:issue, project: project) @@ -724,7 +724,7 @@ describe Issue do end describe '#check_for_spam' do - let(:project) { create :empty_project, visibility_level: visibility_level } + let(:project) { create :project, visibility_level: visibility_level } let(:issue) { create :issue, project: project } subject do diff --git a/spec/models/lfs_objects_project_spec.rb b/spec/models/lfs_objects_project_spec.rb index 8c74f1f9e86..d24d4cf7695 100644 --- a/spec/models/lfs_objects_project_spec.rb +++ b/spec/models/lfs_objects_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe LfsObjectsProject do subject { create(:lfs_objects_project, project: project) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } describe 'associations' do it { is_expected.to belong_to(:project) } diff --git a/spec/models/member_spec.rb b/spec/models/member_spec.rb index 8bfd70b8d46..87513e18b25 100644 --- a/spec/models/member_spec.rb +++ b/spec/models/member_spec.rb @@ -57,7 +57,7 @@ describe Member do describe 'Scopes & finders' do before do - project = create(:empty_project, :public, :access_requestable) + project = create(:project, :public, :access_requestable) group = create(:group) @owner_user = create(:user).tap { |u| group.add_owner(u) } @owner = group.members.find_by(user_id: @owner_user.id) @@ -516,7 +516,7 @@ describe Member do describe "destroying a record", truncate: true do it "refreshes user's authorized projects" do - project = create(:empty_project, :private) + project = create(:project, :private) user = create(:user) member = project.team << [user, :reporter] diff --git a/spec/models/members/project_member_spec.rb b/spec/models/members/project_member_spec.rb index 025fb2bf441..f1d1f37c78a 100644 --- a/spec/models/members/project_member_spec.rb +++ b/spec/models/members/project_member_spec.rb @@ -24,7 +24,7 @@ describe ProjectMember do describe '.add_user' do it 'adds the user as a member' do user = create(:user) - project = create(:empty_project) + project = create(:project) expect(project.users).not_to include(user) @@ -82,8 +82,8 @@ describe ProjectMember do describe '.import_team' do before do - @project_1 = create(:empty_project) - @project_2 = create(:empty_project) + @project_1 = create(:project) + @project_2 = create(:project) @user_1 = create :user @user_2 = create :user @@ -112,7 +112,7 @@ describe ProjectMember do describe '.add_users_to_projects' do it 'adds the given users to the given projects' do - projects = create_list(:empty_project, 2) + projects = create_list(:project, 2) users = create_list(:user, 2) described_class.add_users_to_projects( @@ -130,8 +130,8 @@ describe ProjectMember do describe '.truncate_teams' do before do - @project_1 = create(:empty_project) - @project_2 = create(:empty_project) + @project_1 = create(:project) + @project_2 = create(:project) @user_1 = create :user @user_2 = create :user diff --git a/spec/models/merge_request_spec.rb b/spec/models/merge_request_spec.rb index d9903b9b951..3402c260f27 100644 --- a/spec/models/merge_request_spec.rb +++ b/spec/models/merge_request_spec.rb @@ -237,7 +237,7 @@ describe MergeRequest do end describe '#to_reference' do - let(:project) { build(:empty_project, name: 'sample-project') } + let(:project) { build(:project, name: 'sample-project') } let(:merge_request) { build(:merge_request, target_project: project, iid: 1) } it 'returns a String reference to the object' do @@ -245,7 +245,7 @@ describe MergeRequest do end it 'supports a cross-project reference' do - another_project = build(:empty_project, name: 'another-project', namespace: project.namespace) + another_project = build(:project, name: 'another-project', namespace: project.namespace) expect(merge_request.to_reference(another_project)).to eq "sample-project!1" end @@ -392,8 +392,8 @@ describe MergeRequest do describe '#for_fork?' do it 'returns true if the merge request is for a fork' do - subject.source_project = build_stubbed(:empty_project, namespace: create(:group)) - subject.target_project = build_stubbed(:empty_project, namespace: create(:group)) + subject.source_project = build_stubbed(:project, namespace: create(:group)) + subject.target_project = build_stubbed(:project, namespace: create(:group)) expect(subject.for_fork?).to be_truthy end @@ -889,7 +889,7 @@ describe MergeRequest do end describe '#participants' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:mr) do create(:merge_request, source_project: project, target_project: project) @@ -932,7 +932,7 @@ describe MergeRequest do end describe '#check_if_can_be_merged' do - let(:project) { create(:empty_project, only_allow_merge_if_pipeline_succeeds: true) } + let(:project) { create(:project, only_allow_merge_if_pipeline_succeeds: true) } subject { create(:merge_request, source_project: project, merge_status: :unchecked) } @@ -970,7 +970,7 @@ describe MergeRequest do end describe '#mergeable?' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } subject { create(:merge_request, source_project: project) } @@ -1055,7 +1055,7 @@ describe MergeRequest do end describe '#mergeable_ci_state?' do - let(:project) { create(:empty_project, only_allow_merge_if_pipeline_succeeds: true) } + let(:project) { create(:project, only_allow_merge_if_pipeline_succeeds: true) } let(:pipeline) { create(:ci_empty_pipeline) } subject { build(:merge_request, target_project: project) } @@ -1098,7 +1098,7 @@ describe MergeRequest do end context 'when merges are not restricted to green builds' do - subject { build(:merge_request, target_project: build(:empty_project, only_allow_merge_if_pipeline_succeeds: false)) } + subject { build(:merge_request, target_project: build(:project, only_allow_merge_if_pipeline_succeeds: false)) } context 'and a failed pipeline is associated' do before do @@ -1332,8 +1332,8 @@ describe MergeRequest do end describe "#source_project_missing?" do - let(:project) { create(:empty_project) } - let(:fork_project) { create(:empty_project, forked_from_project: project) } + let(:project) { create(:project) } + let(:fork_project) { create(:project, forked_from_project: project) } let(:user) { create(:user) } let(:unlink_project) { Projects::UnlinkForkService.new(fork_project, user) } @@ -1370,8 +1370,8 @@ describe MergeRequest do end describe "#closed_without_fork?" do - let(:project) { create(:empty_project) } - let(:fork_project) { create(:empty_project, forked_from_project: project) } + let(:project) { create(:project) } + let(:fork_project) { create(:project, forked_from_project: project) } let(:user) { create(:user) } let(:unlink_project) { Projects::UnlinkForkService.new(fork_project, user) } @@ -1416,9 +1416,9 @@ describe MergeRequest do end context 'forked project' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } - let(:fork_project) { create(:empty_project, forked_from_project: project, namespace: user.namespace) } + let(:fork_project) { create(:project, forked_from_project: project, namespace: user.namespace) } let!(:merge_request) do create(:closed_merge_request, diff --git a/spec/models/milestone_spec.rb b/spec/models/milestone_spec.rb index aa376e242e8..b48aa9558d5 100644 --- a/spec/models/milestone_spec.rb +++ b/spec/models/milestone_spec.rb @@ -21,7 +21,7 @@ describe Milestone do it { is_expected.to have_many(:issues) } end - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:milestone) { create(:milestone, project: project) } let(:issue) { create(:issue, project: project) } let(:user) { create(:user) } @@ -42,7 +42,7 @@ describe Milestone do end it "accepts the same title in another project" do - project = create(:empty_project) + project = create(:project) new_milestone = described_class.new(project: project, title: milestone.title) expect(new_milestone).to be_valid @@ -197,9 +197,9 @@ describe Milestone do end describe '.upcoming_ids_by_projects' do - let(:project_1) { create(:empty_project) } - let(:project_2) { create(:empty_project) } - let(:project_3) { create(:empty_project) } + let(:project_1) { create(:project) } + let(:project_2) { create(:project) } + let(:project_3) { create(:project) } let(:projects) { [project_1, project_2, project_3] } let!(:past_milestone_project_1) { create(:milestone, project: project_1, due_date: Time.now - 1.day) } @@ -230,7 +230,7 @@ describe Milestone do end describe '#to_reference' do - let(:project) { build(:empty_project, name: 'sample-project') } + let(:project) { build(:project, name: 'sample-project') } let(:milestone) { build(:milestone, iid: 1, project: project) } it 'returns a String reference to the object' do @@ -238,13 +238,13 @@ describe Milestone do end it 'supports a cross-project reference' do - another_project = build(:empty_project, name: 'another-project', namespace: project.namespace) + another_project = build(:project, name: 'another-project', namespace: project.namespace) expect(milestone.to_reference(another_project)).to eq "sample-project%1" end end describe '#participants' do - let(:project) { build(:empty_project, name: 'sample-project') } + let(:project) { build(:project, name: 'sample-project') } let(:milestone) { build(:milestone, iid: 1, project: project) } it 'returns participants without duplicates' do diff --git a/spec/models/namespace_spec.rb b/spec/models/namespace_spec.rb index f12fe226e6b..1a00c50690c 100644 --- a/spec/models/namespace_spec.rb +++ b/spec/models/namespace_spec.rb @@ -111,7 +111,7 @@ describe Namespace do let(:namespace) { create :namespace } let(:project1) do - create(:empty_project, + create(:project, namespace: namespace, statistics: build(:project_statistics, storage_size: 606, @@ -121,7 +121,7 @@ describe Namespace do end let(:project2) do - create(:empty_project, + create(:project, namespace: namespace, statistics: build(:project_statistics, storage_size: 60, @@ -177,7 +177,7 @@ describe Namespace do stub_container_registry_config(enabled: true) stub_container_registry_tags(repository: :any, tags: ['tag']) - create(:empty_project, namespace: @namespace, container_repositories: [container_repository]) + create(:project, namespace: @namespace, container_repositories: [container_repository]) allow(@namespace).to receive(:path_was).and_return(@namespace.path) allow(@namespace).to receive(:path).and_return('new_path') diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb index cbe6d42ef53..b214074fdce 100644 --- a/spec/models/note_spec.rb +++ b/spec/models/note_spec.rb @@ -46,7 +46,7 @@ describe Note do context 'when noteable and note project differ' do subject do build(:note, noteable: build_stubbed(:issue), - project: build_stubbed(:empty_project)) + project: build_stubbed(:project)) end it { is_expected.to be_invalid } @@ -97,8 +97,8 @@ describe Note do describe 'authorization' do before do - @p1 = create(:empty_project) - @p2 = create(:empty_project) + @p1 = create(:project) + @p2 = create(:project) @u1 = create(:user) @u2 = create(:user) @u3 = create(:user) @@ -195,10 +195,10 @@ describe Note do describe "cross_reference_not_visible_for?" do let(:private_user) { create(:user) } - let(:private_project) { create(:empty_project, namespace: private_user.namespace) { |p| p.team << [private_user, :master] } } + let(:private_project) { create(:project, namespace: private_user.namespace) { |p| p.team << [private_user, :master] } } let(:private_issue) { create(:issue, project: private_project) } - let(:ext_proj) { create(:empty_project, :public) } + let(:ext_proj) { create(:project, :public) } let(:ext_issue) { create(:issue, project: ext_proj) } let(:note) do @@ -241,7 +241,7 @@ describe Note do describe '#participants' do it 'includes the note author' do - project = create(:empty_project, :public) + project = create(:project, :public) issue = create(:issue, project: project) note = create(:note_on_issue, noteable: issue, project: project) diff --git a/spec/models/project_authorization_spec.rb b/spec/models/project_authorization_spec.rb index ee6bdc39c8c..9e7e525b2c0 100644 --- a/spec/models/project_authorization_spec.rb +++ b/spec/models/project_authorization_spec.rb @@ -2,8 +2,8 @@ require 'spec_helper' describe ProjectAuthorization do let(:user) { create(:user) } - let(:project1) { create(:empty_project) } - let(:project2) { create(:empty_project) } + let(:project1) { create(:project) } + let(:project2) { create(:project) } describe '.insert_authorizations' do it 'inserts the authorizations' do diff --git a/spec/models/project_feature_spec.rb b/spec/models/project_feature_spec.rb index 580c83c12c0..de3e86b627f 100644 --- a/spec/models/project_feature_spec.rb +++ b/spec/models/project_feature_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe ProjectFeature do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } describe '.quoted_access_level_column' do @@ -47,7 +47,7 @@ describe ProjectFeature do it "returns true when user is a member of project group" do group = create(:group) - project = create(:empty_project, namespace: group) + project = create(:project, namespace: group) group.add_developer(user) features.each do |feature| diff --git a/spec/models/project_group_link_spec.rb b/spec/models/project_group_link_spec.rb index 0938a7b1b6d..b3513c80150 100644 --- a/spec/models/project_group_link_spec.rb +++ b/spec/models/project_group_link_spec.rb @@ -9,7 +9,7 @@ describe ProjectGroupLink do describe "Validation" do let(:parent_group) { create(:group) } let(:group) { create(:group, parent: parent_group) } - let(:project) { create(:empty_project, group: group) } + let(:project) { create(:project, group: group) } let!(:project_group_link) { create(:project_group_link, project: project) } it { is_expected.to validate_presence_of(:project_id) } @@ -32,7 +32,7 @@ describe ProjectGroupLink do describe "destroying a record", truncate: true do it "refreshes group users' authorized projects" do - project = create(:empty_project, :private) + project = create(:project, :private) group = create(:group) reporter = create(:user) group_users = group.users diff --git a/spec/models/project_label_spec.rb b/spec/models/project_label_spec.rb index c47f32d8d77..689d4e505e5 100644 --- a/spec/models/project_label_spec.rb +++ b/spec/models/project_label_spec.rb @@ -10,7 +10,7 @@ describe ProjectLabel do context 'validates if title must not exist at group level' do let(:group) { create(:group, name: 'gitlab-org') } - let(:project) { create(:empty_project, group: group) } + let(:project) { create(:project, group: group) } before do create(:group_label, group: group, title: 'Bug') @@ -33,7 +33,7 @@ describe ProjectLabel do end it 'does not returns error if project does not belong to group' do - another_project = create(:empty_project) + another_project = create(:project) label = described_class.new(project: another_project, title: 'Bug') label.valid? @@ -66,7 +66,7 @@ describe ProjectLabel do describe '#subject' do it 'aliases project to subject' do - subject = described_class.new(project: build(:empty_project)) + subject = described_class.new(project: build(:project)) expect(subject.subject).to be(subject.project) end @@ -100,7 +100,7 @@ describe ProjectLabel do end context 'cross project reference' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } context 'using name' do it 'returns cross reference with label name' do diff --git a/spec/models/project_services/asana_service_spec.rb b/spec/models/project_services/asana_service_spec.rb index 4684c970885..04440d890aa 100644 --- a/spec/models/project_services/asana_service_spec.rb +++ b/spec/models/project_services/asana_service_spec.rb @@ -18,7 +18,7 @@ describe AsanaService do describe 'Execute' do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } def create_data_for_commits(*messages) { diff --git a/spec/models/project_services/bamboo_service_spec.rb b/spec/models/project_services/bamboo_service_spec.rb index 82f02126de1..85baaccf035 100644 --- a/spec/models/project_services/bamboo_service_spec.rb +++ b/spec/models/project_services/bamboo_service_spec.rb @@ -7,7 +7,7 @@ describe BambooService, :use_clean_rails_memory_store_caching do subject(:service) do described_class.create( - project: create(:empty_project), + project: create(:project), properties: { bamboo_url: bamboo_url, username: 'mic', diff --git a/spec/models/project_services/buildkite_service_spec.rb b/spec/models/project_services/buildkite_service_spec.rb index 3f7eb33e08a..1615a93a4ca 100644 --- a/spec/models/project_services/buildkite_service_spec.rb +++ b/spec/models/project_services/buildkite_service_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe BuildkiteService, :use_clean_rails_memory_store_caching do include ReactiveCachingHelpers - let(:project) { create(:empty_project) } + let(:project) { create(:project) } subject(:service) do described_class.create( diff --git a/spec/models/project_services/chat_notification_service_spec.rb b/spec/models/project_services/chat_notification_service_spec.rb index ae80c4ae002..3aa1039d8bf 100644 --- a/spec/models/project_services/chat_notification_service_spec.rb +++ b/spec/models/project_services/chat_notification_service_spec.rb @@ -12,7 +12,7 @@ describe ChatNotificationService do describe '#can_test?' do context 'with empty repository' do it 'returns true' do - subject.project = create(:empty_project, :empty_repo) + subject.project = create(:project, :empty_repo) expect(subject.can_test?).to be true end diff --git a/spec/models/project_services/external_wiki_service_spec.rb b/spec/models/project_services/external_wiki_service_spec.rb index 22cd9d5e31e..25e6ce7e804 100644 --- a/spec/models/project_services/external_wiki_service_spec.rb +++ b/spec/models/project_services/external_wiki_service_spec.rb @@ -27,7 +27,7 @@ describe ExternalWikiService do end describe 'External wiki' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } context 'when it is active' do before do diff --git a/spec/models/project_services/gitlab_issue_tracker_service_spec.rb b/spec/models/project_services/gitlab_issue_tracker_service_spec.rb index 45cc78c8ff4..3237b660a16 100644 --- a/spec/models/project_services/gitlab_issue_tracker_service_spec.rb +++ b/spec/models/project_services/gitlab_issue_tracker_service_spec.rb @@ -8,21 +8,21 @@ describe GitlabIssueTrackerService do describe 'Validations' do context 'when service is active' do - subject { described_class.new(project: create(:empty_project), active: true) } + subject { described_class.new(project: create(:project), active: true) } it { is_expected.to validate_presence_of(:issues_url) } it_behaves_like 'issue tracker service URL attribute', :issues_url end context 'when service is inactive' do - subject { described_class.new(project: create(:empty_project), active: false) } + subject { described_class.new(project: create(:project), active: false) } it { is_expected.not_to validate_presence_of(:issues_url) } end end describe 'project and issue urls' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:service) { project.create_gitlab_issue_tracker_service(active: true) } context 'with absolute urls' do diff --git a/spec/models/project_services/issue_tracker_service_spec.rb b/spec/models/project_services/issue_tracker_service_spec.rb index 3ca123cb75d..e6a1752576b 100644 --- a/spec/models/project_services/issue_tracker_service_spec.rb +++ b/spec/models/project_services/issue_tracker_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe IssueTrackerService do describe 'Validations' do - let(:project) { create :empty_project } + let(:project) { create :project } describe 'only one issue tracker per project' do let(:service) { RedmineService.new(project: project, active: true) } diff --git a/spec/models/project_services/jira_service_spec.rb b/spec/models/project_services/jira_service_spec.rb index 69bb8f1c725..204a00778a7 100644 --- a/spec/models/project_services/jira_service_spec.rb +++ b/spec/models/project_services/jira_service_spec.rb @@ -29,7 +29,7 @@ describe JiraService do context 'validating urls' do let(:service) do described_class.new( - project: create(:empty_project), + project: create(:project), active: true, username: 'username', password: 'test', @@ -74,7 +74,7 @@ describe JiraService do describe '#close_issue' do let(:custom_base_url) { 'http://custom_url' } let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:merge_request) { create(:merge_request) } before do @@ -190,7 +190,7 @@ describe JiraService do describe '#test_settings' do let(:jira_service) do described_class.new( - project: create(:empty_project), + project: create(:project), url: 'http://jira.example.com', username: 'jira_username', password: 'jira_password' @@ -233,7 +233,7 @@ describe JiraService do end describe "Stored password invalidation" do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } context "when a password was previously set" do before do @@ -338,7 +338,7 @@ describe JiraService do end describe 'description and title' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } context 'when it is not set' do before do @@ -373,7 +373,7 @@ describe JiraService do end describe 'project and issue urls' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } context 'when gitlab.yml was initialized' do before do diff --git a/spec/models/project_services/mattermost_slash_commands_service_spec.rb b/spec/models/project_services/mattermost_slash_commands_service_spec.rb index 4c21c8b88bd..522cf15f3ba 100644 --- a/spec/models/project_services/mattermost_slash_commands_service_spec.rb +++ b/spec/models/project_services/mattermost_slash_commands_service_spec.rb @@ -4,7 +4,7 @@ describe MattermostSlashCommandsService do it_behaves_like "chat slash commands service" context 'Mattermost API' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:service) { project.build_mattermost_slash_commands_service } let(:user) { create(:user) } diff --git a/spec/models/project_services/slack_slash_commands_service_spec.rb b/spec/models/project_services/slack_slash_commands_service_spec.rb index aea674c4f6b..0d95f454819 100644 --- a/spec/models/project_services/slack_slash_commands_service_spec.rb +++ b/spec/models/project_services/slack_slash_commands_service_spec.rb @@ -5,7 +5,7 @@ describe SlackSlashCommandsService do describe '#trigger' do context 'when an auth url is generated' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:params) do { team_domain: 'http://domain.tld', diff --git a/spec/models/project_services/teamcity_service_spec.rb b/spec/models/project_services/teamcity_service_spec.rb index 47fd0c79e0b..43a0ed99296 100644 --- a/spec/models/project_services/teamcity_service_spec.rb +++ b/spec/models/project_services/teamcity_service_spec.rb @@ -7,7 +7,7 @@ describe TeamcityService, :use_clean_rails_memory_store_caching do subject(:service) do described_class.create( - project: create(:empty_project), + project: create(:project), properties: { teamcity_url: teamcity_url, username: 'mic', diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 3bc6fb09778..8f951605954 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -82,7 +82,7 @@ describe Project do end describe '#members & #requesters' do - let(:project) { create(:empty_project, :public, :access_requestable) } + let(:project) { create(:project, :public, :access_requestable) } let(:requester) { create(:user) } let(:developer) { create(:user) } before do @@ -131,7 +131,7 @@ describe Project do end describe 'validation' do - let!(:project) { create(:empty_project) } + let!(:project) { create(:project) } it { is_expected.to validate_presence_of(:name) } it { is_expected.to validate_uniqueness_of(:name).scoped_to(:namespace_id) } @@ -154,7 +154,7 @@ describe Project do it { is_expected.to validate_presence_of(:repository_storage) } it 'does not allow new projects beyond user limits' do - project2 = build(:empty_project) + project2 = build(:project) allow(project2).to receive(:creator).and_return(double(can_create_project?: false, projects_limit: 0).as_null_object) expect(project2).not_to be_valid expect(project2.errors[:limit_reached].first).to match(/Personal project creation is not allowed/) @@ -163,7 +163,7 @@ describe Project do describe 'wiki path conflict' do context "when the new path has been used by the wiki of other Project" do it 'has an error on the name attribute' do - new_project = build_stubbed(:empty_project, namespace_id: project.namespace_id, path: "#{project.path}.wiki") + new_project = build_stubbed(:project, namespace_id: project.namespace_id, path: "#{project.path}.wiki") expect(new_project).not_to be_valid expect(new_project.errors[:name].first).to eq('has already been taken') @@ -172,8 +172,8 @@ describe Project do context "when the new wiki path has been used by the path of other Project" do it 'has an error on the name attribute' do - project_with_wiki_suffix = create(:empty_project, path: 'foo.wiki') - new_project = build_stubbed(:empty_project, namespace_id: project_with_wiki_suffix.namespace_id, path: 'foo') + project_with_wiki_suffix = create(:project, path: 'foo.wiki') + new_project = build_stubbed(:project, namespace_id: project_with_wiki_suffix.namespace_id, path: 'foo') expect(new_project).not_to be_valid expect(new_project.errors[:name].first).to eq('has already been taken') @@ -182,7 +182,7 @@ describe Project do end context 'repository storages inclussion' do - let(:project2) { build(:empty_project, repository_storage: 'missing') } + let(:project2) { build(:project, repository_storage: 'missing') } before do storages = { 'custom' => { 'path' => 'tmp/tests/custom_repositories' } } @@ -196,44 +196,44 @@ describe Project do end it 'does not allow an invalid URI as import_url' do - project2 = build(:empty_project, import_url: 'invalid://') + project2 = build(:project, import_url: 'invalid://') expect(project2).not_to be_valid end it 'does allow a valid URI as import_url' do - project2 = build(:empty_project, import_url: 'ssh://test@gitlab.com/project.git') + project2 = build(:project, import_url: 'ssh://test@gitlab.com/project.git') expect(project2).to be_valid end it 'allows an empty URI' do - project2 = build(:empty_project, import_url: '') + project2 = build(:project, import_url: '') expect(project2).to be_valid end it 'does not produce import data on an empty URI' do - project2 = build(:empty_project, import_url: '') + project2 = build(:project, import_url: '') expect(project2.import_data).to be_nil end it 'does not produce import data on an invalid URI' do - project2 = build(:empty_project, import_url: 'test://') + project2 = build(:project, import_url: 'test://') expect(project2.import_data).to be_nil end it "does not allow blocked import_url localhost" do - project2 = build(:empty_project, import_url: 'http://localhost:9000/t.git') + project2 = build(:project, import_url: 'http://localhost:9000/t.git') expect(project2).to be_invalid expect(project2.errors[:import_url]).to include('imports are not allowed from that URL') end it "does not allow blocked import_url port" do - project2 = build(:empty_project, import_url: 'http://github.com:25/t.git') + project2 = build(:project, import_url: 'http://github.com:25/t.git') expect(project2).to be_invalid expect(project2.errors[:import_url]).to include('imports are not allowed from that URL') @@ -241,11 +241,11 @@ describe Project do describe 'project pending deletion' do let!(:project_pending_deletion) do - create(:empty_project, + create(:project, pending_delete: true) end let(:new_project) do - build(:empty_project, + build(:project, name: project_pending_deletion.name, namespace: project_pending_deletion.namespace) end @@ -261,27 +261,27 @@ describe Project do describe 'path validation' do it 'allows paths reserved on the root namespace' do - project = build(:empty_project, path: 'api') + project = build(:project, path: 'api') expect(project).to be_valid end it 'rejects paths reserved on another level' do - project = build(:empty_project, path: 'tree') + project = build(:project, path: 'tree') expect(project).not_to be_valid end it 'rejects nested paths' do parent = create(:group, :nested, path: 'environments') - project = build(:empty_project, path: 'folders', namespace: parent) + project = build(:project, path: 'folders', namespace: parent) expect(project).not_to be_valid end it 'allows a reserved group name' do parent = create(:group) - project = build(:empty_project, path: 'avatar', namespace: parent) + project = build(:project, path: 'avatar', namespace: parent) expect(project).to be_valid end @@ -290,12 +290,12 @@ describe Project do describe 'project token' do it 'sets an random token if none provided' do - project = FactoryGirl.create :empty_project, runners_token: '' + project = FactoryGirl.create :project, runners_token: '' expect(project.runners_token).not_to eq('') end it 'does not set an random token if one provided' do - project = FactoryGirl.create :empty_project, runners_token: 'my-token' + project = FactoryGirl.create :project, runners_token: 'my-token' expect(project.runners_token).to eq('my-token') end end @@ -323,7 +323,7 @@ describe Project do describe '#to_reference' do let(:owner) { create(:user, name: 'Gitlab') } let(:namespace) { create(:namespace, path: 'sample-namespace', owner: owner) } - let(:project) { create(:empty_project, path: 'sample-project', namespace: namespace) } + let(:project) { create(:project, path: 'sample-project', namespace: namespace) } let(:group) { create(:group, name: 'Group', path: 'sample-group', owner: owner) } context 'when nil argument' do @@ -347,7 +347,7 @@ describe Project do end context 'when cross namespace project argument' do - let(:another_namespace_project) { create(:empty_project, name: 'another-project') } + let(:another_namespace_project) { create(:project, name: 'another-project') } it 'returns complete path to the project' do expect(project.to_reference(another_namespace_project)).to eq 'sample-namespace/sample-project' @@ -355,7 +355,7 @@ describe Project do end context 'when same namespace / cross-project argument' do - let(:another_project) { create(:empty_project, namespace: namespace) } + let(:another_project) { create(:project, namespace: namespace) } it 'returns path to the project' do expect(project.to_reference(another_project)).to eq 'sample-project' @@ -364,7 +364,7 @@ describe Project do context 'when different namespace / cross-project argument' do let(:another_namespace) { create(:namespace, path: 'another-namespace', owner: owner) } - let(:another_project) { create(:empty_project, path: 'another-project', namespace: another_namespace) } + let(:another_project) { create(:project, path: 'another-project', namespace: another_namespace) } it 'returns full path to the project' do expect(project.to_reference(another_project)).to eq 'sample-namespace/sample-project' @@ -389,7 +389,7 @@ describe Project do describe '#to_human_reference' do let(:owner) { create(:user, name: 'Gitlab') } let(:namespace) { create(:namespace, name: 'Sample namespace', owner: owner) } - let(:project) { create(:empty_project, name: 'Sample project', namespace: namespace) } + let(:project) { create(:project, name: 'Sample project', namespace: namespace) } context 'when nil argument' do it 'returns nil' do @@ -404,7 +404,7 @@ describe Project do end context 'when cross namespace project argument' do - let(:another_namespace_project) { create(:empty_project, name: 'another-project') } + let(:another_namespace_project) { create(:project, name: 'another-project') } it 'returns complete name with namespace of the project' do expect(project.to_human_reference(another_namespace_project)).to eq 'Gitlab / Sample project' @@ -412,7 +412,7 @@ describe Project do end context 'when same namespace / cross-project argument' do - let(:another_project) { create(:empty_project, namespace: namespace) } + let(:another_project) { create(:project, namespace: namespace) } it 'returns name of the project' do expect(project.to_human_reference(another_project)).to eq 'Sample project' @@ -421,7 +421,7 @@ describe Project do end describe '#repository_storage_path' do - let(:project) { create(:empty_project, repository_storage: 'custom') } + let(:project) { create(:project, repository_storage: 'custom') } before do FileUtils.mkdir('tmp/tests/custom_repositories') @@ -444,7 +444,7 @@ describe Project do end describe "#web_url" do - let(:project) { create(:empty_project, path: "somewhere") } + let(:project) { create(:project, path: "somewhere") } it 'returns the full web URL for this repo' do expect(project.web_url).to eq("#{Gitlab.config.gitlab.url}/#{project.namespace.full_path}/somewhere") @@ -452,7 +452,7 @@ describe Project do end describe "#new_issue_address" do - let(:project) { create(:empty_project, path: "somewhere") } + let(:project) { create(:project, path: "somewhere") } let(:user) { create(:user) } context 'incoming email enabled' do @@ -481,7 +481,7 @@ describe Project do describe 'last_activity methods' do let(:timestamp) { 2.hours.ago } # last_activity_at gets set to created_at upon creation - let(:project) { create(:empty_project, created_at: timestamp, updated_at: timestamp) } + let(:project) { create(:project, created_at: timestamp, updated_at: timestamp) } describe 'last_activity' do it 'alias last_activity to last_event' do @@ -506,7 +506,7 @@ describe Project do end describe '#get_issue' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let!(:issue) { create(:issue, project: project) } let(:user) { create(:user) } @@ -581,7 +581,7 @@ describe Project do end describe '#issue_exists?' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } it 'is truthy when issue exists' do expect(project).to receive(:get_issue).and_return(double) @@ -598,7 +598,7 @@ describe Project do context 'with namespace' do before do @group = create :group, name: 'gitlab' - @project = create(:empty_project, name: 'gitlabhq', namespace: @group) + @project = create(:project, name: 'gitlabhq', namespace: @group) end it { expect(@project.to_param).to eq('gitlabhq') } @@ -606,7 +606,7 @@ describe Project do context 'with invalid path' do it 'returns previous path to keep project suitable for use in URLs when persisted' do - project = create(:empty_project, path: 'gitlab') + project = create(:project, path: 'gitlab') project.path = 'foo&bar' expect(project).not_to be_valid @@ -614,7 +614,7 @@ describe Project do end it 'returns current path when new record' do - project = build(:empty_project, path: 'gitlab') + project = build(:project, path: 'gitlab') project.path = 'foo&bar' expect(project).not_to be_valid @@ -633,7 +633,7 @@ describe Project do describe '#default_issues_tracker?' do it "is true if used internal tracker" do - project = build(:empty_project) + project = build(:project) expect(project.default_issues_tracker?).to be_truthy end @@ -647,7 +647,7 @@ describe Project do end describe '#external_issue_tracker' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:ext_project) { create(:redmine_project) } context 'on existing projects with no value for has_external_issue_tracker' do @@ -682,7 +682,7 @@ describe Project do end describe '#cache_has_external_issue_tracker' do - let(:project) { create(:empty_project, has_external_issue_tracker: nil) } + let(:project) { create(:project, has_external_issue_tracker: nil) } it 'stores true if there is any external_issue_tracker' do services = double(:service, external_issue_trackers: [RedmineService.new]) @@ -704,9 +704,9 @@ describe Project do end describe '#has_wiki?' do - let(:no_wiki_project) { create(:empty_project, :wiki_disabled, has_external_wiki: false) } - let(:wiki_enabled_project) { create(:empty_project) } - let(:external_wiki_project) { create(:empty_project, has_external_wiki: true) } + let(:no_wiki_project) { create(:project, :wiki_disabled, has_external_wiki: false) } + let(:wiki_enabled_project) { create(:project) } + let(:external_wiki_project) { create(:project, has_external_wiki: true) } it 'returns true if project is wiki enabled or has external wiki' do expect(wiki_enabled_project).to have_wiki @@ -716,7 +716,7 @@ describe Project do end describe '#external_wiki' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } context 'with an active external wiki' do before do @@ -770,7 +770,7 @@ describe Project do it 'counts stars from multiple users' do user1 = create :user user2 = create :user - project = create(:empty_project, :public) + project = create(:project, :public) expect(project.star_count).to eq(0) @@ -792,8 +792,8 @@ describe Project do it 'counts stars on the right project' do user = create :user - project1 = create(:empty_project, :public) - project2 = create(:empty_project, :public) + project1 = create(:project, :public) + project2 = create(:project, :public) expect(project1.star_count).to eq(0) expect(project2.star_count).to eq(0) @@ -825,7 +825,7 @@ describe Project do end describe '#avatar_type' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } it 'is true if avatar is image' do project.update_attribute(:avatar, 'uploads/avatar.png') @@ -841,10 +841,10 @@ describe Project do describe '#avatar_url' do subject { project.avatar_url } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } context 'when avatar file is uploaded' do - let(:project) { create(:empty_project, :with_avatar) } + let(:project) { create(:project, :with_avatar) } let(:avatar_path) { "/uploads/-/system/project/avatar/#{project.id}/dk.png" } let(:gitlab_host) { "http://#{Gitlab.config.gitlab.host}" } @@ -869,7 +869,7 @@ describe Project do end context 'when git repo is empty' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } it { is_expected.to eq nil } end @@ -910,7 +910,7 @@ describe Project do end describe '#builds_enabled' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } subject { project.builds_enabled } @@ -921,7 +921,7 @@ describe Project do subject { described_class.with_shared_runners } context 'when shared runners are enabled for project' do - let!(:project) { create(:empty_project, shared_runners_enabled: true) } + let!(:project) { create(:project, shared_runners_enabled: true) } it "returns a project" do is_expected.to eq([project]) @@ -929,7 +929,7 @@ describe Project do end context 'when shared runners are disabled for project' do - let!(:project) { create(:empty_project, shared_runners_enabled: false) } + let!(:project) { create(:project, shared_runners_enabled: false) } it "returns an empty array" do is_expected.to be_empty @@ -939,8 +939,8 @@ describe Project do describe '.cached_count', :use_clean_rails_memory_store_caching do let(:group) { create(:group, :public) } - let!(:project1) { create(:empty_project, :public, group: group) } - let!(:project2) { create(:empty_project, :public, group: group) } + let!(:project1) { create(:project, :public, group: group) } + let!(:project2) { create(:project, :public, group: group) } it 'returns total project count' do expect(described_class).to receive(:count).once.and_call_original @@ -953,8 +953,8 @@ describe Project do describe '.trending' do let(:group) { create(:group, :public) } - let(:project1) { create(:empty_project, :public, group: group) } - let(:project2) { create(:empty_project, :public, group: group) } + let(:project1) { create(:project, :public, group: group) } + let(:project2) { create(:project, :public, group: group) } before do 2.times do @@ -985,9 +985,9 @@ describe Project do it 'returns only projects starred by the given user' do user1 = create(:user) user2 = create(:user) - project1 = create(:empty_project) - project2 = create(:empty_project) - create(:empty_project) + project1 = create(:project) + project2 = create(:project) + create(:project) user1.toggle_star(project1) user2.toggle_star(project2) @@ -996,7 +996,7 @@ describe Project do end describe '.visible_to_user' do - let!(:project) { create(:empty_project, :private) } + let!(:project) { create(:project, :private) } let!(:user) { create(:user) } subject { described_class.visible_to_user(user) } @@ -1015,7 +1015,7 @@ describe Project do end context 'repository storage by default' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } before do storages = { @@ -1033,7 +1033,7 @@ describe Project do end context 'shared runners by default' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } subject { project.shared_runners_enabled } @@ -1055,7 +1055,7 @@ describe Project do end describe '#any_runners' do - let(:project) { create(:empty_project, shared_runners_enabled: shared_runners_enabled) } + let(:project) { create(:project, shared_runners_enabled: shared_runners_enabled) } let(:specific_runner) { create(:ci_runner) } let(:shared_runner) { create(:ci_runner, :shared) } @@ -1103,7 +1103,7 @@ describe Project do subject { project.shared_runners } context 'when shared runners are enabled for project' do - let!(:project) { create(:empty_project, shared_runners_enabled: true) } + let!(:project) { create(:project, shared_runners_enabled: true) } it "returns a list of shared runners" do is_expected.to eq([runner]) @@ -1111,7 +1111,7 @@ describe Project do end context 'when shared runners are disabled for project' do - let!(:project) { create(:empty_project, shared_runners_enabled: false) } + let!(:project) { create(:project, shared_runners_enabled: false) } it "returns a empty list" do is_expected.to be_empty @@ -1120,7 +1120,7 @@ describe Project do end describe '#visibility_level_allowed?' do - let(:project) { create(:empty_project, :internal) } + let(:project) { create(:project, :internal) } context 'when checking on non-forked project' do it { expect(project.visibility_level_allowed?(Gitlab::VisibilityLevel::PRIVATE)).to be_truthy } @@ -1129,8 +1129,8 @@ describe Project do end context 'when checking on forked project' do - let(:project) { create(:empty_project, :internal) } - let(:forked_project) { create(:empty_project, forked_from_project: project) } + let(:project) { create(:project, :internal) } + let(:forked_project) { create(:project, forked_from_project: project) } it { expect(forked_project.visibility_level_allowed?(Gitlab::VisibilityLevel::PRIVATE)).to be_truthy } it { expect(forked_project.visibility_level_allowed?(Gitlab::VisibilityLevel::INTERNAL)).to be_truthy } @@ -1139,7 +1139,7 @@ describe Project do end describe '#pages_deployed?' do - let(:project) { create :empty_project } + let(:project) { create :project } subject { project.pages_deployed? } @@ -1158,7 +1158,7 @@ describe Project do describe '#pages_url' do let(:group) { create :group, name: group_name } - let(:project) { create :empty_project, namespace: group, name: project_name } + let(:project) { create :project, namespace: group, name: project_name } let(:domain) { 'Example.com' } subject { project.pages_url } @@ -1184,7 +1184,7 @@ describe Project do end describe '.search' do - let(:project) { create(:empty_project, description: 'kitten mittens') } + let(:project) { create(:project, description: 'kitten mittens') } it 'returns projects with a matching name' do expect(described_class.search(project.name)).to eq([project]) @@ -1241,7 +1241,7 @@ describe Project do end describe 'with pending_delete project' do - let(:pending_delete_project) { create(:empty_project, pending_delete: true) } + let(:pending_delete_project) { create(:project, pending_delete: true) } it 'shows pending deletion project' do search_result = described_class.search(pending_delete_project.name) @@ -1327,7 +1327,7 @@ describe Project do end describe '.search_by_title' do - let(:project) { create(:empty_project, name: 'kittens') } + let(:project) { create(:project, name: 'kittens') } it 'returns projects with a matching name' do expect(described_class.search_by_title(project.name)).to eq([project]) @@ -1346,8 +1346,8 @@ describe Project do let(:private_group) { create(:group, visibility_level: 0) } let(:internal_group) { create(:group, visibility_level: 10) } - let(:private_project) { create :empty_project, :private, group: private_group } - let(:internal_project) { create :empty_project, :internal, group: internal_group } + let(:private_project) { create :project, :private, group: private_group } + let(:internal_project) { create :project, :internal, group: internal_group } context 'when group is private project can not be internal' do it { expect(private_project.visibility_level_allowed?(Gitlab::VisibilityLevel::INTERNAL)).to be_falsey } @@ -1444,7 +1444,7 @@ describe Project do end describe '#user_can_push_to_empty_repo?' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:user) } it 'returns false when default_branch_protection is in full protection and user is developer' do @@ -1483,7 +1483,7 @@ describe Project do end describe '#container_registry_url' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } subject { project.container_registry_url } @@ -1510,7 +1510,7 @@ describe Project do end describe '#has_container_registry_tags?' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } context 'when container registry is enabled' do before do @@ -1574,7 +1574,7 @@ describe Project do end describe '#ci_config_path=' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } it 'sets nil' do project.update!(ci_config_path: nil) @@ -1596,7 +1596,7 @@ describe Project do end describe 'Project import job' do - let(:project) { create(:empty_project, import_url: generate(:url)) } + let(:project) { create(:project, import_url: generate(:url)) } before do allow_any_instance_of(Gitlab::Shell).to receive(:import_repository) @@ -1633,7 +1633,7 @@ describe Project do end it 'does not perform housekeeping when project repository does not exist' do - project = create(:empty_project, :import_started, import_type: :github) + project = create(:project, :import_started, import_type: :github) project.import_finish @@ -1641,7 +1641,7 @@ describe Project do end it 'does not perform housekeeping when project does not have a valid import type' do - project = create(:empty_project, :import_started, import_type: nil) + project = create(:project, :import_started, import_type: nil) project.import_finish @@ -1746,7 +1746,7 @@ describe Project do context 'not forked' do it 'schedules a RepositoryImportWorker job' do - project = create(:empty_project, import_url: generate(:url)) + project = create(:project, import_url: generate(:url)) expect(RepositoryImportWorker).to receive(:perform_async).with(project.id) @@ -1756,19 +1756,19 @@ describe Project do end describe '#gitlab_project_import?' do - subject(:project) { build(:empty_project, import_type: 'gitlab_project') } + subject(:project) { build(:project, import_type: 'gitlab_project') } it { expect(project.gitlab_project_import?).to be true } end describe '#gitea_import?' do - subject(:project) { build(:empty_project, import_type: 'gitea') } + subject(:project) { build(:project, import_type: 'gitea') } it { expect(project.gitea_import?).to be true } end describe '#lfs_enabled?' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } shared_examples 'project overrides group' do it 'returns true when enabled in project' do @@ -1858,7 +1858,7 @@ describe Project do end describe '#pushes_since_gc' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } after do project.reset_pushes_since_gc @@ -1880,7 +1880,7 @@ describe Project do end describe '#increment_pushes_since_gc' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } after do project.reset_pushes_since_gc @@ -1894,7 +1894,7 @@ describe Project do end describe '#reset_pushes_since_gc' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } after do project.reset_pushes_since_gc @@ -1911,7 +1911,7 @@ describe Project do describe '#deployment_variables' do context 'when project has no deployment service' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } it 'returns an empty array' do expect(project.deployment_variables).to eq [] @@ -1930,7 +1930,7 @@ describe Project do end describe '#secret_variables_for' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let!(:secret_variable) do create(:ci_variable, value: 'secret', project: project) @@ -1977,7 +1977,7 @@ describe Project do end describe '#protected_for?' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } subject { project.protected_for?('ref') } @@ -2014,7 +2014,7 @@ describe Project do end describe '#update_project_statistics' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } it "is called after creation" do expect(project.statistics).to be_a ProjectStatistics @@ -2034,9 +2034,9 @@ describe Project do end describe 'inside_path' do - let!(:project1) { create(:empty_project, namespace: create(:namespace, path: 'name_pace')) } - let!(:project2) { create(:empty_project) } - let!(:project3) { create(:empty_project, namespace: create(:namespace, path: 'namespace')) } + let!(:project1) { create(:project, namespace: create(:namespace, path: 'name_pace')) } + let!(:project2) { create(:project) } + let!(:project3) { create(:project, namespace: create(:namespace, path: 'namespace')) } let!(:path) { project1.namespace.full_path } it 'returns correct project' do @@ -2121,13 +2121,13 @@ describe Project do end describe '#parent' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } it { expect(project.parent).to eq(project.namespace) } end describe '#parent_changed?' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } before do project.namespace_id = 7 @@ -2153,7 +2153,7 @@ describe Project do end context 'top-level group' do - let(:project) { create :empty_project, namespace: group, name: project_name } + let(:project) { create :project, namespace: group, name: project_name } context 'group page' do let(:project_name) { 'group.example.com' } @@ -2169,7 +2169,7 @@ describe Project do end context 'nested group' do - let(:project) { create :empty_project, namespace: nested_group, name: project_name } + let(:project) { create :project, namespace: nested_group, name: project_name } let(:expected_url) { "http://group.example.com/#{nested_group.path}/#{project.path}" } context 'group page' do @@ -2187,7 +2187,7 @@ describe Project do end describe '#http_url_to_repo' do - let(:project) { create :empty_project } + let(:project) { create :project } it 'returns the url to the repo without a username' do expect(project.http_url_to_repo).to eq("#{project.web_url}.git") @@ -2207,7 +2207,7 @@ describe Project do end describe '#append_or_update_attribute' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } it 'shows full error updating an invalid MR' do error_message = 'Failed to replace merge_requests because one or more of the new records could not be saved.'\ @@ -2227,7 +2227,7 @@ describe Project do describe '#last_repository_updated_at' do it 'sets to created_at upon creation' do - project = create(:empty_project, created_at: 2.hours.ago) + project = create(:project, created_at: 2.hours.ago) expect(project.last_repository_updated_at.to_i).to eq(project.created_at.to_i) end @@ -2237,10 +2237,10 @@ describe Project do let!(:user) { create(:user) } let!(:private_project) do - create(:empty_project, :private, creator: user, namespace: user.namespace) + create(:project, :private, creator: user, namespace: user.namespace) end - let!(:public_project) { create(:empty_project, :public) } + let!(:public_project) { create(:project, :public) } context 'with a user' do let(:projects) do @@ -2266,7 +2266,7 @@ describe Project do end describe '#remove_private_deploy_keys' do - let!(:project) { create(:empty_project) } + let!(:project) { create(:project) } context 'for a private deploy key' do let!(:key) { create(:deploy_key, public: false) } @@ -2282,7 +2282,7 @@ describe Project do context 'when the key is linked to another project' do before do - another_project = create(:empty_project) + another_project = create(:project) create(:deploy_keys_project, deploy_key: key, project: another_project) end diff --git a/spec/models/project_statistics_spec.rb b/spec/models/project_statistics_spec.rb index be1b37730b1..59e20e84c2f 100644 --- a/spec/models/project_statistics_spec.rb +++ b/spec/models/project_statistics_spec.rb @@ -1,7 +1,7 @@ require 'rails_helper' describe ProjectStatistics do - let(:project) { create :empty_project } + let(:project) { create :project } let(:statistics) { project.statistics } describe 'constants' do diff --git a/spec/models/project_team_spec.rb b/spec/models/project_team_spec.rb index 9ccd366a48e..314824b32da 100644 --- a/spec/models/project_team_spec.rb +++ b/spec/models/project_team_spec.rb @@ -7,7 +7,7 @@ describe ProjectTeam do let(:nonmember) { create(:user) } context 'personal project' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } before do project.add_master(master) @@ -37,7 +37,7 @@ describe ProjectTeam do context 'group project' do let(:group) { create(:group) } - let!(:project) { create(:empty_project, group: group) } + let!(:project) { create(:project, group: group) } before do group.add_master(master) @@ -75,7 +75,7 @@ describe ProjectTeam do describe '#fetch_members' do context 'personal project' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } it 'returns project members' do user = create(:user) @@ -119,7 +119,7 @@ describe ProjectTeam do context 'group project' do let(:group) { create(:group) } - let!(:project) { create(:empty_project, group: group) } + let!(:project) { create(:project, group: group) } it 'returns project members' do group_member = create(:group_member, group: group) @@ -139,7 +139,7 @@ describe ProjectTeam do describe '#find_member' do context 'personal project' do let(:project) do - create(:empty_project, :public, :access_requestable) + create(:project, :public, :access_requestable) end let(:requester) { create(:user) } @@ -160,7 +160,7 @@ describe ProjectTeam do context 'group project' do let(:group) { create(:group, :access_requestable) } - let(:project) { create(:empty_project, group: group) } + let(:project) { create(:project, group: group) } let(:requester) { create(:user) } before do @@ -182,7 +182,7 @@ describe ProjectTeam do it 'returns Master role' do user = create(:user) group = create(:group) - project = create(:empty_project, namespace: group) + project = create(:project, namespace: group) group.add_master(user) @@ -192,7 +192,7 @@ describe ProjectTeam do it 'returns Owner role' do user = create(:user) group = create(:group) - project = create(:empty_project, namespace: group) + project = create(:project, namespace: group) group.add_owner(user) @@ -205,7 +205,7 @@ describe ProjectTeam do context 'personal project' do let(:project) do - create(:empty_project, :public, :access_requestable) + create(:project, :public, :access_requestable) end context 'when project is not shared with group' do @@ -253,7 +253,7 @@ describe ProjectTeam do context 'group project' do let(:group) { create(:group, :access_requestable) } let!(:project) do - create(:empty_project, group: group) + create(:project, group: group) end before do @@ -277,15 +277,15 @@ describe ProjectTeam do let(:master) { create(:user) } let(:personal_project) do - create(:empty_project, namespace: developer.namespace) + create(:project, namespace: developer.namespace) end let(:group_project) do - create(:empty_project, namespace: group) + create(:project, namespace: group) end - let(:members_project) { create(:empty_project) } - let(:shared_project) { create(:empty_project) } + let(:members_project) { create(:project) } + let(:shared_project) { create(:project) } before do group.add_master(master) @@ -330,7 +330,7 @@ describe ProjectTeam do end shared_examples 'max member access for users' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:group) { create(:group) } let(:second_group) { create(:group) } diff --git a/spec/models/project_wiki_spec.rb b/spec/models/project_wiki_spec.rb index 484fcfc88a3..6e33431bbe9 100644 --- a/spec/models/project_wiki_spec.rb +++ b/spec/models/project_wiki_spec.rb @@ -1,7 +1,7 @@ require "spec_helper" describe ProjectWiki do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:repository) { project.repository } let(:user) { project.owner } let(:gitlab_shell) { Gitlab::Shell.new } @@ -42,7 +42,7 @@ describe ProjectWiki do end describe "#http_url_to_repo" do - let(:project) { create :empty_project } + let(:project) { create :project } it 'returns the full http url to the repo' do expected_url = "#{Gitlab.config.gitlab.url}/#{subject.full_path}.git" diff --git a/spec/models/protected_branch_spec.rb b/spec/models/protected_branch_spec.rb index a54af3bfe59..4c677200ae2 100644 --- a/spec/models/protected_branch_spec.rb +++ b/spec/models/protected_branch_spec.rb @@ -163,7 +163,7 @@ describe ProtectedBranch do end context "new project" do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } it 'returns false when default_protected_branch is unprotected' do stub_application_setting(default_branch_protection: Gitlab::Access::PROTECTION_NONE) diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb index 3107037925b..764f548be45 100644 --- a/spec/models/repository_spec.rb +++ b/spec/models/repository_spec.rb @@ -515,7 +515,7 @@ describe Repository do end it 'properly handles query when repo is empty' do - repository = create(:empty_project).repository + repository = create(:project).repository results = repository.search_files_by_content('test', 'master') expect(results).to match_array([]) @@ -543,7 +543,7 @@ describe Repository do end it 'properly handles query when repo is empty' do - repository = create(:empty_project).repository + repository = create(:project).repository results = repository.search_files_by_name('test', 'master') @@ -942,7 +942,7 @@ describe Repository do end it 'expires creation and branch cache' do - empty_repository = create(:empty_project, :empty_repo).repository + empty_repository = create(:project, :empty_repo).repository expect(empty_repository).to receive(:expire_exists_cache) expect(empty_repository).to receive(:expire_root_ref_cache) @@ -1804,7 +1804,7 @@ describe Repository do end describe '#commit_count_for_ref' do - let(:project) { create :empty_project } + let(:project) { create :project } context 'with a non-existing repository' do it 'returns 0' do diff --git a/spec/models/service_spec.rb b/spec/models/service_spec.rb index dba9fc4ac9b..0f2f906c667 100644 --- a/spec/models/service_spec.rb +++ b/spec/models/service_spec.rb @@ -23,7 +23,7 @@ describe Service do end context 'when repository is empty' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } it 'returns true' do expect(service.can_test?).to be true @@ -46,7 +46,7 @@ describe Service do end context 'when repository is empty' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } it 'test runs execute' do expect(service).to receive(:execute).with(data) @@ -69,7 +69,7 @@ describe Service do api_key: '123456789' }) end - let(:project) { create(:empty_project) } + let(:project) { create(:project) } describe 'is prefilled for projects pushover service' do it "has all fields prefilled" do @@ -88,7 +88,7 @@ describe Service do describe "{property}_changed?" do let(:service) do BambooService.create( - project: create(:empty_project), + project: create(:project), properties: { bamboo_url: 'http://gitlab.com', username: 'mic', @@ -128,7 +128,7 @@ describe Service do describe "{property}_touched?" do let(:service) do BambooService.create( - project: create(:empty_project), + project: create(:project), properties: { bamboo_url: 'http://gitlab.com', username: 'mic', @@ -168,7 +168,7 @@ describe Service do describe "{property}_was" do let(:service) do BambooService.create( - project: create(:empty_project), + project: create(:project), properties: { bamboo_url: 'http://gitlab.com', username: 'mic', @@ -208,7 +208,7 @@ describe Service do describe 'initialize service with no properties' do let(:service) do GitlabIssueTrackerService.create( - project: create(:empty_project), + project: create(:project), title: 'random title' ) end @@ -223,7 +223,7 @@ describe Service do end describe "callbacks" do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let!(:service) do RedmineService.new( project: project, diff --git a/spec/models/snippet_spec.rb b/spec/models/snippet_spec.rb index 904bf2c6144..de3ca300ae3 100644 --- a/spec/models/snippet_spec.rb +++ b/spec/models/snippet_spec.rb @@ -33,7 +33,7 @@ describe Snippet do describe '#to_reference' do context 'when snippet belongs to a project' do - let(:project) { build(:empty_project, name: 'sample-project') } + let(:project) { build(:project, name: 'sample-project') } let(:snippet) { build(:snippet, id: 1, project: project) } it 'returns a String reference to the object' do @@ -41,7 +41,7 @@ describe Snippet do end it 'supports a cross-project reference' do - another_project = build(:empty_project, name: 'another-project', namespace: project.namespace) + another_project = build(:project, name: 'another-project', namespace: project.namespace) expect(snippet.to_reference(another_project)).to eq "sample-project$1" end end @@ -54,14 +54,14 @@ describe Snippet do end it 'still returns shortest reference when project arg present' do - another_project = build(:empty_project, name: 'another-project') + another_project = build(:project, name: 'another-project') expect(snippet.to_reference(another_project)).to eq "$1" end end end describe '#file_name' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } context 'file_name is nil' do let(:snippet) { create(:snippet, project: project, file_name: nil) } @@ -132,7 +132,7 @@ describe Snippet do end describe '#participants' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:snippet) { create(:snippet, content: 'foo', project: project) } let!(:note1) do diff --git a/spec/models/trending_project_spec.rb b/spec/models/trending_project_spec.rb index cc28c6d4004..3b5e7ca0d39 100644 --- a/spec/models/trending_project_spec.rb +++ b/spec/models/trending_project_spec.rb @@ -2,11 +2,11 @@ require 'spec_helper' describe TrendingProject do let(:user) { create(:user) } - let(:public_project1) { create(:empty_project, :public) } - let(:public_project2) { create(:empty_project, :public) } - let(:public_project3) { create(:empty_project, :public) } - let(:private_project) { create(:empty_project, :private) } - let(:internal_project) { create(:empty_project, :internal) } + let(:public_project1) { create(:project, :public) } + let(:public_project2) { create(:project, :public) } + let(:public_project3) { create(:project, :public) } + let(:private_project) { create(:project, :private) } + let(:internal_project) { create(:project, :internal) } before do 3.times do diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index ec98a3f3498..a6bd6052006 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -80,7 +80,7 @@ describe User do describe '#project_members' do it 'does not include project memberships for which user is a requester' do user = create(:user) - project = create(:empty_project, :public, :access_requestable) + project = create(:project, :public, :access_requestable) project.request_access(user) expect(user.project_members).to be_empty @@ -560,11 +560,11 @@ describe User do before do @user = create(:user) - @project = create(:empty_project, namespace: @user.namespace) - @project_2 = create(:empty_project, group: create(:group)) do |project| + @project = create(:project, namespace: @user.namespace) + @project_2 = create(:project, group: create(:group)) do |project| project.add_master(@user) end - @project_3 = create(:empty_project, group: create(:group)) do |project| + @project_3 = create(:project, group: create(:group)) do |project| project.add_developer(@user) end end @@ -609,7 +609,7 @@ describe User do describe 'namespaced' do before do @user = create :user - @project = create(:empty_project, namespace: @user.namespace) + @project = create(:project, namespace: @user.namespace) end it { expect(@user.several_namespaces?).to be_falsey } @@ -666,7 +666,7 @@ describe User do end describe '.without_projects' do - let!(:project) { create(:empty_project, :public, :access_requestable) } + let!(:project) { create(:project, :public, :access_requestable) } let!(:user) { create(:user) } let!(:user_without_project) { create(:user) } let!(:user_without_project2) { create(:user) } @@ -1196,8 +1196,8 @@ describe User do describe '#starred?' do it 'determines if user starred a project' do user = create :user - project1 = create(:empty_project, :public) - project2 = create(:empty_project, :public) + project1 = create(:project, :public) + project2 = create(:project, :public) expect(user.starred?(project1)).to be_falsey expect(user.starred?(project2)).to be_falsey @@ -1223,7 +1223,7 @@ describe User do describe '#toggle_star' do it 'toggles stars' do user = create :user - project = create(:empty_project, :public) + project = create(:project, :public) expect(user.starred?(project)).to be_falsey user.toggle_star(project) @@ -1276,9 +1276,9 @@ describe User do describe "#contributed_projects" do subject { create(:user) } - let!(:project1) { create(:empty_project) } - let!(:project2) { create(:empty_project, forked_from_project: project3) } - let!(:project3) { create(:empty_project) } + let!(:project1) { create(:project) } + let!(:project2) { create(:project, forked_from_project: project3) } + let!(:project3) { create(:project) } let!(:merge_request) { create(:merge_request, source_project: project2, target_project: project3, author: subject) } let!(:push_event) { create(:event, :pushed, project: project1, target: project1, author: subject) } let!(:merge_event) { create(:event, :created, project: project3, target: merge_request, author: subject) } @@ -1376,7 +1376,7 @@ describe User do context 'with a minimum access level' do it 'includes projects for which the user is an owner' do user = create(:user) - project = create(:empty_project, :private, namespace: user.namespace) + project = create(:project, :private, namespace: user.namespace) expect(user.authorized_projects(Gitlab::Access::REPORTER)) .to contain_exactly(project) @@ -1384,7 +1384,7 @@ describe User do it 'includes projects for which the user is a master' do user = create(:user) - project = create(:empty_project, :private) + project = create(:project, :private) project.team << [user, Gitlab::Access::MASTER] @@ -1395,7 +1395,7 @@ describe User do it "includes user's personal projects" do user = create(:user) - project = create(:empty_project, :private, namespace: user.namespace) + project = create(:project, :private, namespace: user.namespace) expect(user.authorized_projects).to include(project) end @@ -1403,7 +1403,7 @@ describe User do it "includes personal projects user has been given access to" do user1 = create(:user) user2 = create(:user) - project = create(:empty_project, :private, namespace: user1.namespace) + project = create(:project, :private, namespace: user1.namespace) project.team << [user2, Gitlab::Access::DEVELOPER] @@ -1412,7 +1412,7 @@ describe User do it "includes projects of groups user has been added to" do group = create(:group) - project = create(:empty_project, group: group) + project = create(:project, group: group) user = create(:user) group.add_developer(user) @@ -1422,7 +1422,7 @@ describe User do it "does not include projects of groups user has been removed from" do group = create(:group) - project = create(:empty_project, group: group) + project = create(:project, group: group) user = create(:user) member = group.add_developer(user) @@ -1434,7 +1434,7 @@ describe User do it "includes projects shared with user's group" do user = create(:user) - project = create(:empty_project, :private) + project = create(:project, :private) group = create(:group) group.add_reporter(user) @@ -1446,7 +1446,7 @@ describe User do it "does not include destroyed projects user had access to" do user1 = create(:user) user2 = create(:user) - project = create(:empty_project, :private, namespace: user1.namespace) + project = create(:project, :private, namespace: user1.namespace) project.team << [user2, Gitlab::Access::DEVELOPER] expect(user2.authorized_projects).to include(project) @@ -1457,7 +1457,7 @@ describe User do it "does not include projects of destroyed groups user had access to" do group = create(:group) - project = create(:empty_project, namespace: group) + project = create(:project, namespace: group) user = create(:user) group.add_developer(user) @@ -1472,9 +1472,9 @@ describe User do let(:user) { create(:user) } it 'includes projects for which the user access level is above or equal to reporter' do - reporter_project = create(:empty_project) { |p| p.add_reporter(user) } - developer_project = create(:empty_project) { |p| p.add_developer(user) } - master_project = create(:empty_project) { |p| p.add_master(user) } + reporter_project = create(:project) { |p| p.add_reporter(user) } + developer_project = create(:project) { |p| p.add_developer(user) } + master_project = create(:project) { |p| p.add_master(user) } expect(user.projects_where_can_admin_issues.to_a).to eq([master_project, developer_project, reporter_project]) expect(user.can?(:admin_issue, master_project)).to eq(true) @@ -1483,8 +1483,8 @@ describe User do end it 'does not include for which the user access level is below reporter' do - project = create(:empty_project) - guest_project = create(:empty_project) { |p| p.add_guest(user) } + project = create(:project) + guest_project = create(:project) { |p| p.add_guest(user) } expect(user.projects_where_can_admin_issues.to_a).to be_empty expect(user.can?(:admin_issue, guest_project)).to eq(false) @@ -1492,14 +1492,14 @@ describe User do end it 'does not include archived projects' do - project = create(:empty_project, :archived) + project = create(:project, :archived) expect(user.projects_where_can_admin_issues.to_a).to be_empty expect(user.can?(:admin_issue, project)).to eq(false) end it 'does not include projects for which issues are disabled' do - project = create(:empty_project, :issues_disabled) + project = create(:project, :issues_disabled) expect(user.projects_where_can_admin_issues.to_a).to be_empty expect(user.can?(:admin_issue, project)).to eq(false) @@ -1515,7 +1515,7 @@ describe User do end context 'without any projects' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } it 'does not load' do expect(user.ci_authorized_runners).to be_empty @@ -1524,7 +1524,7 @@ describe User do context 'with personal projects runners' do let(:namespace) { create(:namespace, owner: user) } - let(:project) { create(:empty_project, namespace: namespace) } + let(:project) { create(:project, namespace: namespace) } it 'loads' do expect(user.ci_authorized_runners).to contain_exactly(runner) @@ -1555,7 +1555,7 @@ describe User do context 'with groups projects runners' do let(:group) { create(:group) } - let(:project) { create(:empty_project, group: group) } + let(:project) { create(:project, group: group) } def add_user(access) group.add_user(user, access) @@ -1565,7 +1565,7 @@ describe User do end context 'with other projects runners' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } def add_user(access) project.team << [user, access] @@ -1576,8 +1576,8 @@ describe User do end describe '#projects_with_reporter_access_limited_to' do - let(:project1) { create(:empty_project) } - let(:project2) { create(:empty_project) } + let(:project1) { create(:project) } + let(:project2) { create(:project) } let(:user) { create(:user) } before do @@ -1719,8 +1719,8 @@ describe User do end describe '#refresh_authorized_projects', clean_gitlab_redis_shared_state: true do - let(:project1) { create(:empty_project) } - let(:project2) { create(:empty_project) } + let(:project1) { create(:project) } + let(:project2) { create(:project) } let(:user) { create(:user) } before do diff --git a/spec/models/wiki_page_spec.rb b/spec/models/wiki_page_spec.rb index 55d9c4ddd7b..b7eb412a8de 100644 --- a/spec/models/wiki_page_spec.rb +++ b/spec/models/wiki_page_spec.rb @@ -1,7 +1,7 @@ require "spec_helper" describe WikiPage do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { project.owner } let(:wiki) { ProjectWiki.new(project, user) } |