Commit c202da25 authored by charlie ablett's avatar charlie ablett

Replace owner with first_owner in lib specs

parent 2f33a8cb
...@@ -5,7 +5,7 @@ require 'spec_helper' ...@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe API::Entities::BasicProjectDetails do RSpec.describe API::Entities::BasicProjectDetails do
let_it_be(:project) { create(:project) } let_it_be(:project) { create(:project) }
let(:current_user) { project.owner } let(:current_user) { project.first_owner }
subject(:output) { described_class.new(project, current_user: current_user).as_json } subject(:output) { described_class.new(project, current_user: current_user).as_json }
......
...@@ -160,7 +160,7 @@ RSpec.describe API::Helpers do ...@@ -160,7 +160,7 @@ RSpec.describe API::Helpers do
describe '#find_project!' do describe '#find_project!' do
let_it_be(:project) { create(:project) } let_it_be(:project) { create(:project) }
let(:user) { project.owner} let(:user) { project.first_owner}
before do before do
allow(subject).to receive(:current_user).and_return(user) allow(subject).to receive(:current_user).and_return(user)
......
...@@ -38,7 +38,7 @@ RSpec.describe Backup::GitalyBackup do ...@@ -38,7 +38,7 @@ RSpec.describe Backup::GitalyBackup do
create(:wiki_page, container: project) create(:wiki_page, container: project)
create(:design, :with_file, issue: create(:issue, project: project)) create(:design, :with_file, issue: create(:issue, project: project))
project_snippet = create(:project_snippet, :repository, project: project) project_snippet = create(:project_snippet, :repository, project: project)
personal_snippet = create(:personal_snippet, :repository, author: project.owner) personal_snippet = create(:personal_snippet, :repository, author: project.first_owner)
expect(Open3).to receive(:popen2).with(expected_env, anything, 'create', '-path', anything).and_call_original expect(Open3).to receive(:popen2).with(expected_env, anything, 'create', '-path', anything).and_call_original
...@@ -122,8 +122,8 @@ RSpec.describe Backup::GitalyBackup do ...@@ -122,8 +122,8 @@ RSpec.describe Backup::GitalyBackup do
context 'restore' do context 'restore' do
let_it_be(:project) { create(:project, :repository) } let_it_be(:project) { create(:project, :repository) }
let_it_be(:personal_snippet) { create(:personal_snippet, author: project.owner) } let_it_be(:personal_snippet) { create(:personal_snippet, author: project.first_owner) }
let_it_be(:project_snippet) { create(:project_snippet, project: project, author: project.owner) } let_it_be(:project_snippet) { create(:project_snippet, project: project, author: project.first_owner) }
def copy_bundle_to_backup_path(bundle_name, destination) def copy_bundle_to_backup_path(bundle_name, destination)
FileUtils.mkdir_p(File.join(Gitlab.config.backup.path, 'repositories', File.dirname(destination))) FileUtils.mkdir_p(File.join(Gitlab.config.backup.path, 'repositories', File.dirname(destination)))
......
...@@ -25,7 +25,7 @@ RSpec.describe Backup::GitalyRpcBackup do ...@@ -25,7 +25,7 @@ RSpec.describe Backup::GitalyRpcBackup do
create(:wiki_page, container: project) create(:wiki_page, container: project)
create(:design, :with_file, issue: create(:issue, project: project)) create(:design, :with_file, issue: create(:issue, project: project))
project_snippet = create(:project_snippet, :repository, project: project) project_snippet = create(:project_snippet, :repository, project: project)
personal_snippet = create(:personal_snippet, :repository, author: project.owner) personal_snippet = create(:personal_snippet, :repository, author: project.first_owner)
subject.start(:create) subject.start(:create)
subject.enqueue(project, Gitlab::GlRepository::PROJECT) subject.enqueue(project, Gitlab::GlRepository::PROJECT)
...@@ -75,8 +75,8 @@ RSpec.describe Backup::GitalyRpcBackup do ...@@ -75,8 +75,8 @@ RSpec.describe Backup::GitalyRpcBackup do
context 'restore' do context 'restore' do
let_it_be(:project) { create(:project, :repository) } let_it_be(:project) { create(:project, :repository) }
let_it_be(:personal_snippet) { create(:personal_snippet, author: project.owner) } let_it_be(:personal_snippet) { create(:personal_snippet, author: project.first_owner) }
let_it_be(:project_snippet) { create(:project_snippet, project: project, author: project.owner) } let_it_be(:project_snippet) { create(:project_snippet, project: project, author: project.first_owner) }
def copy_bundle_to_backup_path(bundle_name, destination) def copy_bundle_to_backup_path(bundle_name, destination)
FileUtils.mkdir_p(File.join(Gitlab.config.backup.path, 'repositories', File.dirname(destination))) FileUtils.mkdir_p(File.join(Gitlab.config.backup.path, 'repositories', File.dirname(destination)))
......
...@@ -15,7 +15,7 @@ RSpec.describe Backup::Repositories do ...@@ -15,7 +15,7 @@ RSpec.describe Backup::Repositories do
RSpec.shared_examples 'creates repository bundles' do RSpec.shared_examples 'creates repository bundles' do
it 'calls enqueue for each repository type', :aggregate_failures do it 'calls enqueue for each repository type', :aggregate_failures do
project_snippet = create(:project_snippet, :repository, project: project) project_snippet = create(:project_snippet, :repository, project: project)
personal_snippet = create(:personal_snippet, :repository, author: project.owner) personal_snippet = create(:personal_snippet, :repository, author: project.first_owner)
subject.dump(max_concurrency: 1, max_storage_concurrency: 1) subject.dump(max_concurrency: 1, max_storage_concurrency: 1)
...@@ -172,8 +172,8 @@ RSpec.describe Backup::Repositories do ...@@ -172,8 +172,8 @@ RSpec.describe Backup::Repositories do
describe '#restore' do describe '#restore' do
let_it_be(:project) { create(:project) } let_it_be(:project) { create(:project) }
let_it_be(:personal_snippet) { create(:personal_snippet, author: project.owner) } let_it_be(:personal_snippet) { create(:personal_snippet, author: project.first_owner) }
let_it_be(:project_snippet) { create(:project_snippet, project: project, author: project.owner) } let_it_be(:project_snippet) { create(:project_snippet, project: project, author: project.first_owner) }
it 'calls enqueue for each repository type', :aggregate_failures do it 'calls enqueue for each repository type', :aggregate_failures do
subject.restore subject.restore
......
...@@ -515,7 +515,7 @@ RSpec.describe Banzai::Filter::References::IssueReferenceFilter do ...@@ -515,7 +515,7 @@ RSpec.describe Banzai::Filter::References::IssueReferenceFilter do
enable_design_management(enabled) enable_design_management(enabled)
end end
let(:current_user) { project.owner } let(:current_user) { project.first_owner }
let(:enabled) { true } let(:enabled) { true }
let(:matches) { Issue.link_reference_pattern.match(input_text) } let(:matches) { Issue.link_reference_pattern.match(input_text) }
let(:extras) { subject.object_link_text_extras(issue, matches) } let(:extras) { subject.object_link_text_extras(issue, matches) }
......
...@@ -4,7 +4,7 @@ require 'spec_helper' ...@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe Banzai::ObjectRenderer do RSpec.describe Banzai::ObjectRenderer do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:user) { project.owner } let(:user) { project.first_owner }
let(:renderer) do let(:renderer) do
described_class.new( described_class.new(
default_project: project, default_project: project,
......
...@@ -728,13 +728,13 @@ RSpec.describe Feature, stub_feature_flags: false do ...@@ -728,13 +728,13 @@ RSpec.describe Feature, stub_feature_flags: false do
describe '#targets' do describe '#targets' do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:group) { create(:group) } let(:group) { create(:group) }
let(:user_name) { project.owner.username } let(:user_name) { project.first_owner.username }
subject { described_class.new(user: user_name, project: project.full_path, group: group.full_path) } subject { described_class.new(user: user_name, project: project.full_path, group: group.full_path) }
it 'returns all found targets' do it 'returns all found targets' do
expect(subject.targets).to be_an(Array) expect(subject.targets).to be_an(Array)
expect(subject.targets).to eq([project.owner, project, group]) expect(subject.targets).to eq([project.first_owner, project, group])
end end
end end
end end
......
...@@ -45,7 +45,7 @@ RSpec.describe Gitlab::Ci::Config::External::Rules do ...@@ -45,7 +45,7 @@ RSpec.describe Gitlab::Ci::Config::External::Rules do
let(:context) { double(project: project, sha: project.repository.tree.sha, top_level_worktree_paths: ['Dockerfile']) } let(:context) { double(project: project, sha: project.repository.tree.sha, top_level_worktree_paths: ['Dockerfile']) }
before do before do
project.repository.create_file(project.owner, 'Dockerfile', "commit", message: 'test', branch_name: "master") project.repository.create_file(project.first_owner, 'Dockerfile', "commit", message: 'test', branch_name: "master")
end end
it { is_expected.to eq(true) } it { is_expected.to eq(true) }
......
...@@ -8,7 +8,7 @@ RSpec.describe '5-Minute-Production-App.gitlab-ci.yml' do ...@@ -8,7 +8,7 @@ RSpec.describe '5-Minute-Production-App.gitlab-ci.yml' do
describe 'the created pipeline' do describe 'the created pipeline' do
let_it_be(:project) { create(:project, :auto_devops, :custom_repo, files: { 'README.md' => '' }) } let_it_be(:project) { create(:project, :auto_devops, :custom_repo, files: { 'README.md' => '' }) }
let(:user) { project.owner } let(:user) { project.first_owner }
let(:default_branch) { 'master' } let(:default_branch) { 'master' }
let(:pipeline_branch) { default_branch } let(:pipeline_branch) { default_branch }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch ) } let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch ) }
......
...@@ -9,7 +9,7 @@ RSpec.describe 'Deploy-ECS.gitlab-ci.yml' do ...@@ -9,7 +9,7 @@ RSpec.describe 'Deploy-ECS.gitlab-ci.yml' do
let(:default_branch) { project.default_branch_or_main } let(:default_branch) { project.default_branch_or_main }
let(:pipeline_branch) { default_branch } let(:pipeline_branch) { default_branch }
let(:project) { create(:project, :auto_devops, :custom_repo, files: { 'README.md' => '' }) } let(:project) { create(:project, :auto_devops, :custom_repo, files: { 'README.md' => '' }) }
let(:user) { project.owner } let(:user) { project.first_owner }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch ) } let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch ) }
let(:pipeline) { service.execute!(:push).payload } let(:pipeline) { service.execute!(:push).payload }
let(:build_names) { pipeline.builds.pluck(:name) } let(:build_names) { pipeline.builds.pluck(:name) }
......
...@@ -7,7 +7,7 @@ RSpec.describe 'Jobs/Build.gitlab-ci.yml' do ...@@ -7,7 +7,7 @@ RSpec.describe 'Jobs/Build.gitlab-ci.yml' do
describe 'the created pipeline' do describe 'the created pipeline' do
let_it_be(:project) { create(:project, :repository) } let_it_be(:project) { create(:project, :repository) }
let_it_be(:user) { project.owner } let_it_be(:user) { project.first_owner }
let(:default_branch) { 'master' } let(:default_branch) { 'master' }
let(:pipeline_ref) { default_branch } let(:pipeline_ref) { default_branch }
......
...@@ -7,7 +7,7 @@ RSpec.describe 'Jobs/Code-Quality.gitlab-ci.yml' do ...@@ -7,7 +7,7 @@ RSpec.describe 'Jobs/Code-Quality.gitlab-ci.yml' do
describe 'the created pipeline' do describe 'the created pipeline' do
let_it_be(:project) { create(:project, :repository) } let_it_be(:project) { create(:project, :repository) }
let_it_be(:user) { project.owner } let_it_be(:user) { project.first_owner }
let(:default_branch) { 'master' } let(:default_branch) { 'master' }
let(:pipeline_ref) { default_branch } let(:pipeline_ref) { default_branch }
......
...@@ -29,7 +29,7 @@ RSpec.describe 'Jobs/Deploy.gitlab-ci.yml' do ...@@ -29,7 +29,7 @@ RSpec.describe 'Jobs/Deploy.gitlab-ci.yml' do
describe 'the created pipeline' do describe 'the created pipeline' do
let_it_be(:project, refind: true) { create(:project, :repository) } let_it_be(:project, refind: true) { create(:project, :repository) }
let(:user) { project.owner } let(:user) { project.first_owner }
let(:default_branch) { 'master' } let(:default_branch) { 'master' }
let(:pipeline_ref) { default_branch } let(:pipeline_ref) { default_branch }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_ref) } let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_ref) }
......
...@@ -7,7 +7,7 @@ RSpec.describe 'Jobs/SAST-IaC.latest.gitlab-ci.yml' do ...@@ -7,7 +7,7 @@ RSpec.describe 'Jobs/SAST-IaC.latest.gitlab-ci.yml' do
describe 'the created pipeline' do describe 'the created pipeline' do
let_it_be(:project) { create(:project, :repository) } let_it_be(:project) { create(:project, :repository) }
let_it_be(:user) { project.owner } let_it_be(:user) { project.first_owner }
let(:default_branch) { 'main' } let(:default_branch) { 'main' }
let(:pipeline_ref) { default_branch } let(:pipeline_ref) { default_branch }
......
...@@ -7,7 +7,7 @@ RSpec.describe 'Jobs/Test.gitlab-ci.yml' do ...@@ -7,7 +7,7 @@ RSpec.describe 'Jobs/Test.gitlab-ci.yml' do
describe 'the created pipeline' do describe 'the created pipeline' do
let_it_be(:project) { create(:project, :repository) } let_it_be(:project) { create(:project, :repository) }
let_it_be(:user) { project.owner } let_it_be(:user) { project.first_owner }
let(:default_branch) { 'master' } let(:default_branch) { 'master' }
let(:pipeline_ref) { default_branch } let(:pipeline_ref) { default_branch }
......
...@@ -9,7 +9,7 @@ RSpec.describe 'Terraform/Base.gitlab-ci.yml' do ...@@ -9,7 +9,7 @@ RSpec.describe 'Terraform/Base.gitlab-ci.yml' do
let(:default_branch) { 'master' } let(:default_branch) { 'master' }
let(:pipeline_branch) { default_branch } let(:pipeline_branch) { default_branch }
let(:project) { create(:project, :custom_repo, files: { 'README.md' => '' }) } let(:project) { create(:project, :custom_repo, files: { 'README.md' => '' }) }
let(:user) { project.owner } let(:user) { project.first_owner }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch ) } let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch ) }
let(:pipeline) { service.execute!(:push).payload } let(:pipeline) { service.execute!(:push).payload }
let(:build_names) { pipeline.builds.pluck(:name) } let(:build_names) { pipeline.builds.pluck(:name) }
......
...@@ -9,7 +9,7 @@ RSpec.describe 'Terraform/Base.latest.gitlab-ci.yml' do ...@@ -9,7 +9,7 @@ RSpec.describe 'Terraform/Base.latest.gitlab-ci.yml' do
let(:default_branch) { 'master' } let(:default_branch) { 'master' }
let(:pipeline_branch) { default_branch } let(:pipeline_branch) { default_branch }
let(:project) { create(:project, :custom_repo, files: { 'README.md' => '' }) } let(:project) { create(:project, :custom_repo, files: { 'README.md' => '' }) }
let(:user) { project.owner } let(:user) { project.first_owner }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch ) } let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch ) }
let(:pipeline) { service.execute!(:push).payload } let(:pipeline) { service.execute!(:push).payload }
let(:build_names) { pipeline.builds.pluck(:name) } let(:build_names) { pipeline.builds.pluck(:name) }
......
...@@ -20,7 +20,7 @@ RSpec.describe 'Verify/Load-Performance-Testing.gitlab-ci.yml' do ...@@ -20,7 +20,7 @@ RSpec.describe 'Verify/Load-Performance-Testing.gitlab-ci.yml' do
describe 'the created pipeline' do describe 'the created pipeline' do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:user) { project.owner } let(:user) { project.first_owner }
let(:default_branch) { 'master' } let(:default_branch) { 'master' }
let(:pipeline_ref) { default_branch } let(:pipeline_ref) { default_branch }
......
...@@ -15,7 +15,7 @@ RSpec.describe 'Auto-DevOps.gitlab-ci.yml' do ...@@ -15,7 +15,7 @@ RSpec.describe 'Auto-DevOps.gitlab-ci.yml' do
describe 'the created pipeline' do describe 'the created pipeline' do
let(:pipeline_branch) { default_branch } let(:pipeline_branch) { default_branch }
let(:project) { create(:project, :auto_devops, :custom_repo, files: { 'README.md' => '' }) } let(:project) { create(:project, :auto_devops, :custom_repo, files: { 'README.md' => '' }) }
let(:user) { project.owner } let(:user) { project.first_owner }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch ) } let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch ) }
let(:pipeline) { service.execute!(:push).payload } let(:pipeline) { service.execute!(:push).payload }
let(:build_names) { pipeline.builds.pluck(:name) } let(:build_names) { pipeline.builds.pluck(:name) }
...@@ -276,7 +276,7 @@ RSpec.describe 'Auto-DevOps.gitlab-ci.yml' do ...@@ -276,7 +276,7 @@ RSpec.describe 'Auto-DevOps.gitlab-ci.yml' do
with_them do with_them do
let(:project) { create(:project, :custom_repo, files: files) } let(:project) { create(:project, :custom_repo, files: files) }
let(:user) { project.owner } let(:user) { project.first_owner }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: default_branch ) } let(:service) { Ci::CreatePipelineService.new(project, user, ref: default_branch ) }
let(:pipeline) { service.execute(:push).payload } let(:pipeline) { service.execute(:push).payload }
let(:build_names) { pipeline.builds.pluck(:name) } let(:build_names) { pipeline.builds.pluck(:name) }
......
...@@ -8,7 +8,7 @@ RSpec.describe 'Flutter.gitlab-ci.yml' do ...@@ -8,7 +8,7 @@ RSpec.describe 'Flutter.gitlab-ci.yml' do
describe 'the created pipeline' do describe 'the created pipeline' do
let(:pipeline_branch) { 'master' } let(:pipeline_branch) { 'master' }
let(:project) { create(:project, :custom_repo, files: { 'README.md' => '' }) } let(:project) { create(:project, :custom_repo, files: { 'README.md' => '' }) }
let(:user) { project.owner } let(:user) { project.first_owner }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch ) } let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch ) }
let(:pipeline) { service.execute!(:push).payload } let(:pipeline) { service.execute!(:push).payload }
let(:build_names) { pipeline.builds.pluck(:name) } let(:build_names) { pipeline.builds.pluck(:name) }
......
...@@ -8,7 +8,7 @@ RSpec.describe 'Kaniko.gitlab-ci.yml' do ...@@ -8,7 +8,7 @@ RSpec.describe 'Kaniko.gitlab-ci.yml' do
describe 'the created pipeline' do describe 'the created pipeline' do
let(:pipeline_branch) { 'master' } let(:pipeline_branch) { 'master' }
let(:project) { create(:project, :custom_repo, files: { 'Dockerfile' => 'FROM alpine:latest' }) } let(:project) { create(:project, :custom_repo, files: { 'Dockerfile' => 'FROM alpine:latest' }) }
let(:user) { project.owner } let(:user) { project.first_owner }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch ) } let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch ) }
let(:pipeline) { service.execute!(:push).payload } let(:pipeline) { service.execute!(:push).payload }
let(:build_names) { pipeline.builds.pluck(:name) } let(:build_names) { pipeline.builds.pluck(:name) }
......
...@@ -9,7 +9,7 @@ RSpec.describe 'npm.gitlab-ci.yml' do ...@@ -9,7 +9,7 @@ RSpec.describe 'npm.gitlab-ci.yml' do
let(:repo_files) { { 'package.json' => '{}', 'README.md' => '' } } let(:repo_files) { { 'package.json' => '{}', 'README.md' => '' } }
let(:modified_files) { %w[package.json] } let(:modified_files) { %w[package.json] }
let(:project) { create(:project, :custom_repo, files: repo_files) } let(:project) { create(:project, :custom_repo, files: repo_files) }
let(:user) { project.owner } let(:user) { project.first_owner }
let(:pipeline_branch) { project.default_branch } let(:pipeline_branch) { project.default_branch }
let(:pipeline_tag) { 'v1.2.1' } let(:pipeline_tag) { 'v1.2.1' }
let(:pipeline_ref) { pipeline_branch } let(:pipeline_ref) { pipeline_branch }
......
...@@ -13,7 +13,7 @@ RSpec.describe 'Terraform.gitlab-ci.yml' do ...@@ -13,7 +13,7 @@ RSpec.describe 'Terraform.gitlab-ci.yml' do
let(:default_branch) { project.default_branch_or_main } let(:default_branch) { project.default_branch_or_main }
let(:pipeline_branch) { default_branch } let(:pipeline_branch) { default_branch }
let(:project) { create(:project, :custom_repo, files: { 'README.md' => '' }) } let(:project) { create(:project, :custom_repo, files: { 'README.md' => '' }) }
let(:user) { project.owner } let(:user) { project.first_owner }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch ) } let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch ) }
let(:pipeline) { service.execute!(:push).payload } let(:pipeline) { service.execute!(:push).payload }
let(:build_names) { pipeline.builds.pluck(:name) } let(:build_names) { pipeline.builds.pluck(:name) }
......
...@@ -13,7 +13,7 @@ RSpec.describe 'Terraform.latest.gitlab-ci.yml' do ...@@ -13,7 +13,7 @@ RSpec.describe 'Terraform.latest.gitlab-ci.yml' do
let(:default_branch) { project.default_branch_or_main } let(:default_branch) { project.default_branch_or_main }
let(:pipeline_branch) { default_branch } let(:pipeline_branch) { default_branch }
let(:project) { create(:project, :custom_repo, files: { 'README.md' => '' }) } let(:project) { create(:project, :custom_repo, files: { 'README.md' => '' }) }
let(:user) { project.owner } let(:user) { project.first_owner }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch ) } let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch ) }
let(:pipeline) { service.execute!(:push).payload } let(:pipeline) { service.execute!(:push).payload }
let(:build_names) { pipeline.builds.pluck(:name) } let(:build_names) { pipeline.builds.pluck(:name) }
......
...@@ -5,7 +5,7 @@ require 'spec_helper' ...@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe Gitlab::Ci::Variables::Builder do RSpec.describe Gitlab::Ci::Variables::Builder do
let_it_be(:project) { create(:project, :repository) } let_it_be(:project) { create(:project, :repository) }
let_it_be(:pipeline) { create(:ci_pipeline, project: project) } let_it_be(:pipeline) { create(:ci_pipeline, project: project) }
let_it_be(:user) { project.owner } let_it_be(:user) { project.first_owner }
let_it_be(:job) do let_it_be(:job) do
create(:ci_build, create(:ci_build,
pipeline: pipeline, pipeline: pipeline,
......
...@@ -13,7 +13,7 @@ RSpec.describe Gitlab::Diff::File do ...@@ -13,7 +13,7 @@ RSpec.describe Gitlab::Diff::File do
def create_file(file_name, content) def create_file(file_name, content)
Files::CreateService.new( Files::CreateService.new(
project, project,
project.owner, project.first_owner,
commit_message: 'Update', commit_message: 'Update',
start_branch: branch_name, start_branch: branch_name,
branch_name: branch_name, branch_name: branch_name,
...@@ -27,7 +27,7 @@ RSpec.describe Gitlab::Diff::File do ...@@ -27,7 +27,7 @@ RSpec.describe Gitlab::Diff::File do
def update_file(file_name, content) def update_file(file_name, content)
Files::UpdateService.new( Files::UpdateService.new(
project, project,
project.owner, project.first_owner,
commit_message: 'Update', commit_message: 'Update',
start_branch: branch_name, start_branch: branch_name,
branch_name: branch_name, branch_name: branch_name,
...@@ -41,7 +41,7 @@ RSpec.describe Gitlab::Diff::File do ...@@ -41,7 +41,7 @@ RSpec.describe Gitlab::Diff::File do
def delete_file(file_name) def delete_file(file_name)
Files::DeleteService.new( Files::DeleteService.new(
project, project,
project.owner, project.first_owner,
commit_message: 'Update', commit_message: 'Update',
start_branch: branch_name, start_branch: branch_name,
branch_name: branch_name, branch_name: branch_name,
......
...@@ -6,7 +6,7 @@ RSpec.describe Gitlab::Diff::PositionTracer::ImageStrategy do ...@@ -6,7 +6,7 @@ RSpec.describe Gitlab::Diff::PositionTracer::ImageStrategy do
include PositionTracerHelpers include PositionTracerHelpers
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:current_user) { project.owner } let(:current_user) { project.first_owner }
let(:file_name) { 'test-file' } let(:file_name) { 'test-file' }
let(:new_file_name) { "#{file_name}-new" } let(:new_file_name) { "#{file_name}-new" }
let(:second_file_name) { "#{file_name}-2" } let(:second_file_name) { "#{file_name}-2" }
......
...@@ -55,7 +55,7 @@ RSpec.describe Gitlab::Diff::PositionTracer::LineStrategy, :clean_gitlab_redis_c ...@@ -55,7 +55,7 @@ RSpec.describe Gitlab::Diff::PositionTracer::LineStrategy, :clean_gitlab_redis_c
include PositionTracerHelpers include PositionTracerHelpers
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:current_user) { project.owner } let(:current_user) { project.first_owner }
let(:repository) { project.repository } let(:repository) { project.repository }
let(:file_name) { "test-file" } let(:file_name) { "test-file" }
let(:new_file_name) { "#{file_name}-new" } let(:new_file_name) { "#{file_name}-new" }
......
...@@ -52,7 +52,7 @@ RSpec.describe Gitlab::Diff::PositionTracer do ...@@ -52,7 +52,7 @@ RSpec.describe Gitlab::Diff::PositionTracer do
describe 'diffs methods' do describe 'diffs methods' do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:current_user) { project.owner } let(:current_user) { project.first_owner }
let(:old_diff_refs) do let(:old_diff_refs) do
diff_refs( diff_refs(
......
...@@ -6,7 +6,7 @@ RSpec.describe Gitlab::Git::Wiki do ...@@ -6,7 +6,7 @@ RSpec.describe Gitlab::Git::Wiki do
using RSpec::Parameterized::TableSyntax using RSpec::Parameterized::TableSyntax
let(:project) { create(:project) } let(:project) { create(:project) }
let(:user) { project.owner } let(:user) { project.first_owner }
let(:project_wiki) { ProjectWiki.new(project, user) } let(:project_wiki) { ProjectWiki.new(project, user) }
subject(:wiki) { project_wiki.wiki } subject(:wiki) { project_wiki.wiki }
......
...@@ -5,7 +5,7 @@ RSpec.describe Gitlab::GitAccessDesign do ...@@ -5,7 +5,7 @@ RSpec.describe Gitlab::GitAccessDesign do
include DesignManagementTestHelpers include DesignManagementTestHelpers
let_it_be(:project) { create(:project) } let_it_be(:project) { create(:project) }
let_it_be(:user) { project.owner } let_it_be(:user) { project.first_owner }
let(:protocol) { 'web' } let(:protocol) { 'web' }
let(:actor) { user } let(:actor) { user }
......
...@@ -4,8 +4,8 @@ require 'spec_helper' ...@@ -4,8 +4,8 @@ require 'spec_helper'
RSpec.describe Gitlab::GlRepository::Identifier do RSpec.describe Gitlab::GlRepository::Identifier do
let_it_be(:project) { create(:project) } let_it_be(:project) { create(:project) }
let_it_be(:personal_snippet) { create(:personal_snippet, author: project.owner) } let_it_be(:personal_snippet) { create(:personal_snippet, author: project.first_owner) }
let_it_be(:project_snippet) { create(:project_snippet, project: project, author: project.owner) } let_it_be(:project_snippet) { create(:project_snippet, project: project, author: project.first_owner) }
describe 'project repository' do describe 'project repository' do
it_behaves_like 'parsing gl_repository identifier' do it_behaves_like 'parsing gl_repository identifier' do
......
...@@ -3,8 +3,8 @@ require 'spec_helper' ...@@ -3,8 +3,8 @@ require 'spec_helper'
RSpec.describe Gitlab::GlRepository::RepoType do RSpec.describe Gitlab::GlRepository::RepoType do
let_it_be(:project) { create(:project) } let_it_be(:project) { create(:project) }
let_it_be(:personal_snippet) { create(:personal_snippet, author: project.owner) } let_it_be(:personal_snippet) { create(:personal_snippet, author: project.first_owner) }
let_it_be(:project_snippet) { create(:project_snippet, project: project, author: project.owner) } let_it_be(:project_snippet) { create(:project_snippet, project: project, author: project.first_owner) }
let(:project_path) { project.repository.full_path } let(:project_path) { project.repository.full_path }
let(:wiki_path) { project.wiki.repository.full_path } let(:wiki_path) { project.wiki.repository.full_path }
......
...@@ -73,7 +73,7 @@ RSpec.describe Gitlab::Graphql::MarkdownField do ...@@ -73,7 +73,7 @@ RSpec.describe Gitlab::Graphql::MarkdownField do
end end
it 'shows the reference to users that are allowed to see it' do it 'shows the reference to users that are allowed to see it' do
context = GraphQL::Query::Context.new(query: query, values: { current_user: project.owner }, object: nil) context = GraphQL::Query::Context.new(query: query, values: { current_user: project.first_owner }, object: nil)
type_instance = type_class.authorized_new(note, context) type_instance = type_class.authorized_new(note, context)
expect(field.to_graphql.resolve(type_instance, {}, context)).to include(issue_path(issue)) expect(field.to_graphql.resolve(type_instance, {}, context)).to include(issue_path(issue))
......
...@@ -334,7 +334,7 @@ RSpec.describe Gitlab::ProjectAuthorizations do ...@@ -334,7 +334,7 @@ RSpec.describe Gitlab::ProjectAuthorizations do
let(:common_id) { non_existing_record_id } let(:common_id) { non_existing_record_id }
let!(:group) { create(:group, id: common_id) } let!(:group) { create(:group, id: common_id) }
let!(:unrelated_project) { create(:project, id: common_id) } let!(:unrelated_project) { create(:project, id: common_id) }
let(:user) { unrelated_project.owner } let(:user) { unrelated_project.first_owner }
it 'does not have access to group and its projects' do it 'does not have access to group and its projects' do
mapping = map_access_levels(authorizations) mapping = map_access_levels(authorizations)
......
...@@ -8,7 +8,7 @@ RSpec.describe Sidebars::Projects::Menus::AnalyticsMenu do ...@@ -8,7 +8,7 @@ RSpec.describe Sidebars::Projects::Menus::AnalyticsMenu do
create(:user).tap { |u| project.add_guest(u) } create(:user).tap { |u| project.add_guest(u) }
end end
let(:owner) { project.owner } let(:owner) { project.first_owner }
let(:current_user) { owner } let(:current_user) { owner }
let(:context) { Sidebars::Projects::Context.new(current_user: current_user, container: project, current_ref: project.repository.root_ref) } let(:context) { Sidebars::Projects::Context.new(current_user: current_user, container: project, current_ref: project.repository.root_ref) }
......
...@@ -4,7 +4,7 @@ require 'spec_helper' ...@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::CiCdMenu do RSpec.describe Sidebars::Projects::Menus::CiCdMenu do
let(:project) { build(:project) } let(:project) { build(:project) }
let(:user) { project.owner } let(:user) { project.first_owner }
let(:can_view_pipeline_editor) { true } let(:can_view_pipeline_editor) { true }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project, current_ref: 'master', can_view_pipeline_editor: can_view_pipeline_editor) } let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project, current_ref: 'master', can_view_pipeline_editor: can_view_pipeline_editor) }
......
...@@ -5,7 +5,7 @@ require 'spec_helper' ...@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::ConfluenceMenu do RSpec.describe Sidebars::Projects::Menus::ConfluenceMenu do
let_it_be_with_refind(:project) { create(:project, has_external_wiki: true) } let_it_be_with_refind(:project) { create(:project, has_external_wiki: true) }
let(:user) { project.owner } let(:user) { project.first_owner }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) } let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) }
subject { described_class.new(context) } subject { described_class.new(context) }
......
...@@ -5,7 +5,7 @@ require 'spec_helper' ...@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::DeploymentsMenu do RSpec.describe Sidebars::Projects::Menus::DeploymentsMenu do
let_it_be(:project) { create(:project, :repository) } let_it_be(:project) { create(:project, :repository) }
let(:user) { project.owner } let(:user) { project.first_owner }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) } let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) }
describe '#render?' do describe '#render?' do
......
...@@ -4,7 +4,7 @@ require 'spec_helper' ...@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::ExternalIssueTrackerMenu do RSpec.describe Sidebars::Projects::Menus::ExternalIssueTrackerMenu do
let(:project) { build(:project) } let(:project) { build(:project) }
let(:user) { project.owner } let(:user) { project.first_owner }
let(:jira_issues_integration_active) { false } let(:jira_issues_integration_active) { false }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project, jira_issues_integration: jira_issues_integration_active) } let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project, jira_issues_integration: jira_issues_integration_active) }
......
...@@ -4,7 +4,7 @@ require 'spec_helper' ...@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::ExternalWikiMenu do RSpec.describe Sidebars::Projects::Menus::ExternalWikiMenu do
let(:project) { build(:project) } let(:project) { build(:project) }
let(:user) { project.owner } let(:user) { project.first_owner }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) } let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) }
subject { described_class.new(context) } subject { described_class.new(context) }
......
...@@ -5,7 +5,7 @@ require 'spec_helper' ...@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::HiddenMenu do RSpec.describe Sidebars::Projects::Menus::HiddenMenu do
let_it_be(:project) { create(:project, :repository) } let_it_be(:project) { create(:project, :repository) }
let(:user) { project.owner } let(:user) { project.first_owner }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project, current_ref: project.repository.root_ref) } let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project, current_ref: project.repository.root_ref) }
describe '#render?' do describe '#render?' do
......
...@@ -4,7 +4,7 @@ require 'spec_helper' ...@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::InfrastructureMenu do RSpec.describe Sidebars::Projects::Menus::InfrastructureMenu do
let(:project) { build(:project) } let(:project) { build(:project) }
let(:user) { project.owner } let(:user) { project.first_owner }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project, show_cluster_hint: false) } let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project, show_cluster_hint: false) }
describe '#render?' do describe '#render?' do
......
...@@ -11,7 +11,7 @@ RSpec.describe Sidebars::Projects::Menus::InviteTeamMembersMenu do ...@@ -11,7 +11,7 @@ RSpec.describe Sidebars::Projects::Menus::InviteTeamMembersMenu do
subject(:invite_menu) { described_class.new(context) } subject(:invite_menu) { described_class.new(context) }
context 'when the project is viewed by an owner of the group' do context 'when the project is viewed by an owner of the group' do
let(:owner) { project.owner } let(:owner) { project.first_owner }
describe '#render?' do describe '#render?' do
it 'renders the Invite team members link' do it 'renders the Invite team members link' do
......
...@@ -4,7 +4,7 @@ require 'spec_helper' ...@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::IssuesMenu do RSpec.describe Sidebars::Projects::Menus::IssuesMenu do
let(:project) { build(:project) } let(:project) { build(:project) }
let(:user) { project.owner } let(:user) { project.first_owner }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) } let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) }
subject { described_class.new(context) } subject { described_class.new(context) }
......
...@@ -5,7 +5,7 @@ require 'spec_helper' ...@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::MergeRequestsMenu do RSpec.describe Sidebars::Projects::Menus::MergeRequestsMenu do
let_it_be(:project) { create(:project, :repository) } let_it_be(:project) { create(:project, :repository) }
let(:user) { project.owner } let(:user) { project.first_owner }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) } let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) }
subject { described_class.new(context) } subject { described_class.new(context) }
......
...@@ -5,7 +5,7 @@ require 'spec_helper' ...@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::MonitorMenu do RSpec.describe Sidebars::Projects::Menus::MonitorMenu do
let_it_be_with_refind(:project) { create(:project) } let_it_be_with_refind(:project) { create(:project) }
let(:user) { project.owner } let(:user) { project.first_owner }
let(:show_cluster_hint) { true } let(:show_cluster_hint) { true }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project, show_cluster_hint: show_cluster_hint) } let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project, show_cluster_hint: show_cluster_hint) }
......
...@@ -5,7 +5,7 @@ require 'spec_helper' ...@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::PackagesRegistriesMenu do RSpec.describe Sidebars::Projects::Menus::PackagesRegistriesMenu do
let_it_be(:project) { create(:project) } let_it_be(:project) { create(:project) }
let(:user) { project.owner } let(:user) { project.first_owner }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) } let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) }
subject { described_class.new(context) } subject { described_class.new(context) }
......
...@@ -5,7 +5,7 @@ require 'spec_helper' ...@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::ProjectInformationMenu do RSpec.describe Sidebars::Projects::Menus::ProjectInformationMenu do
let_it_be_with_reload(:project) { create(:project, :repository) } let_it_be_with_reload(:project) { create(:project, :repository) }
let(:user) { project.owner } let(:user) { project.first_owner }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) } let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) }
describe '#container_html_options' do describe '#container_html_options' do
......
...@@ -5,7 +5,7 @@ require 'spec_helper' ...@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::RepositoryMenu do RSpec.describe Sidebars::Projects::Menus::RepositoryMenu do
let_it_be(:project) { create(:project, :repository) } let_it_be(:project) { create(:project, :repository) }
let(:user) { project.owner } let(:user) { project.first_owner }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project, current_ref: 'master') } let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project, current_ref: 'master') }
subject { described_class.new(context) } subject { described_class.new(context) }
......
...@@ -4,7 +4,7 @@ require 'spec_helper' ...@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::ScopeMenu do RSpec.describe Sidebars::Projects::Menus::ScopeMenu do
let(:project) { build(:project) } let(:project) { build(:project) }
let(:user) { project.owner } let(:user) { project.first_owner }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) } let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) }
describe '#container_html_options' do describe '#container_html_options' do
......
...@@ -5,7 +5,7 @@ require 'spec_helper' ...@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::SecurityComplianceMenu do RSpec.describe Sidebars::Projects::Menus::SecurityComplianceMenu do
let_it_be(:project) { create(:project) } let_it_be(:project) { create(:project) }
let(:user) { project.owner } let(:user) { project.first_owner }
let(:show_promotions) { true } let(:show_promotions) { true }
let(:show_discover_project_security) { true } let(:show_discover_project_security) { true }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project, show_promotions: show_promotions, show_discover_project_security: show_discover_project_security) } let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project, show_promotions: show_promotions, show_discover_project_security: show_discover_project_security) }
......
...@@ -5,7 +5,7 @@ require 'spec_helper' ...@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::SettingsMenu do RSpec.describe Sidebars::Projects::Menus::SettingsMenu do
let_it_be(:project) { create(:project) } let_it_be(:project) { create(:project) }
let(:user) { project.owner } let(:user) { project.first_owner }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) } let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) }
subject { described_class.new(context) } subject { described_class.new(context) }
......
...@@ -5,7 +5,7 @@ require 'spec_helper' ...@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::ShimoMenu do RSpec.describe Sidebars::Projects::Menus::ShimoMenu do
let_it_be_with_reload(:project) { create(:project) } let_it_be_with_reload(:project) { create(:project) }
let(:context) { Sidebars::Projects::Context.new(current_user: project.owner, container: project) } let(:context) { Sidebars::Projects::Context.new(current_user: project.first_owner, container: project) }
subject(:shimo_menu) { described_class.new(context) } subject(:shimo_menu) { described_class.new(context) }
......
...@@ -4,7 +4,7 @@ require 'spec_helper' ...@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::SnippetsMenu do RSpec.describe Sidebars::Projects::Menus::SnippetsMenu do
let(:project) { build(:project) } let(:project) { build(:project) }
let(:user) { project.owner } let(:user) { project.first_owner }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) } let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) }
subject { described_class.new(context) } subject { described_class.new(context) }
......
...@@ -4,7 +4,7 @@ require 'spec_helper' ...@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::WikiMenu do RSpec.describe Sidebars::Projects::Menus::WikiMenu do
let(:project) { build(:project) } let(:project) { build(:project) }
let(:user) { project.owner } let(:user) { project.first_owner }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) } let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) }
subject { described_class.new(context) } subject { described_class.new(context) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment