Commit 31834bbc authored by James Fargher's avatar James Fargher

Merge branch '350603-cablett-project-owner-specs-13' into 'master'

Replace owner with first_owner in G-L EE specs

See merge request gitlab-org/gitlab!79184
parents 333c6edc ba59f471
......@@ -7,7 +7,7 @@ RSpec.describe Mutations::Ci::CiCdSettingsUpdate do
let_it_be(:project) { create(:project) }
let(:user) { project.owner }
let(:user) { project.first_owner }
let(:mutation) { described_class.new(object: nil, context: { current_user: user }, field: nil) }
subject { mutation.resolve(full_path: project.full_path, **mutation_params) }
......
......@@ -67,7 +67,7 @@ RSpec.describe Mutations::Projects::SetComplianceFramework do
end
context 'current_user is a project owner' do
let(:current_user) { project.owner }
let(:current_user) { project.first_owner }
it_behaves_like "the user can change a project's compliance framework"
end
......
......@@ -7,7 +7,7 @@ RSpec.describe Resolvers::NetworkPolicyResolver do
let_it_be(:project) { create(:project) }
let(:user) { project.owner }
let(:user) { project.first_owner }
let(:time_now) { Time.utc(2021, 6, 16) }
let(:policy) do
......
......@@ -8,7 +8,7 @@ RSpec.describe Resolvers::PathLocksResolver do
let_it_be(:project) { create(:project) }
let_it_be(:path_lock) { create(:path_lock, path: 'README.md', project: project) }
let(:user) { project.owner }
let(:user) { project.first_owner }
describe '#resolve' do
subject(:resolve_path_locks) { resolve(described_class, obj: project, lookahead: positive_lookahead, ctx: { current_user: user }) }
......
......@@ -6,7 +6,7 @@ RSpec.describe Resolvers::SecurityReportSummaryResolver do
include GraphqlHelpers
let_it_be(:pipeline) { create(:ci_pipeline) }
let_it_be(:user) { pipeline.project.owner }
let_it_be(:user) { pipeline.project.first_owner }
describe '#resolve' do
before do
......
......@@ -35,7 +35,7 @@ RSpec.describe Projects::Security::PoliciesHelper do
end
describe '#orchestration_policy_data' do
let(:owner) { project.owner }
let(:owner) { project.first_owner }
let(:base_data) do
{
assigned_policy_project: "null",
......
......@@ -21,7 +21,7 @@ RSpec.describe ProjectsHelper do
end
describe '#can_update_security_orchestration_policy_project?' do
let(:owner) { project.owner }
let(:owner) { project.first_owner }
before do
allow(helper).to receive(:current_user) { owner }
......
......@@ -6,7 +6,7 @@ RSpec.describe PushRulesHelper do
let(:global_push_rule) { create(:push_rule_sample) }
let(:push_rule) { create(:push_rule) }
let(:admin) { create(:admin) }
let(:project_owner) { push_rule.project.owner }
let(:project_owner) { push_rule.project.first_owner }
let(:possible_help_texts) do
{
commit_committer_check_base_help: /Users can only push commits to this repository that were committed with one of their own verified emails/,
......
......@@ -6,7 +6,7 @@ RSpec.describe Gitlab::GitAccessDesign do
using RSpec::Parameterized::TableSyntax
let_it_be(:project) { create(:project) }
let_it_be(:user) { project.owner }
let_it_be(:user) { project.first_owner }
let(:actor) { :geo }
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::AnalyticsMenu do
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) }
subject { described_class.new(context) }
......
......@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::CiCdMenu do
let(:project) { build(:project) }
let(:user) { project.owner }
let(:user) { project.first_owner }
let(:context) { Sidebars::Projects::Context.new(current_user: user, current_ref: 'main', container: project, can_view_pipeline_editor: true) }
describe 'Test Cases' do
......
......@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::IssuesMenu do
let(:project) { build(:project) }
let(:user) { project.owner }
let(:user) { project.first_owner }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) }
describe '#render?' do
......
......@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::MonitorMenu do
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: true) }
describe 'Menu items' do
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::RepositoryMenu do
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') }
describe 'File Locks' do
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::SecurityComplianceMenu do
let_it_be(:project) { create(:project) }
let(:user) { project.owner }
let(:user) { project.first_owner }
let(:show_promotions) { 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) }
......
......@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::ZentaoMenu do
let(:project) { create(:project, has_external_issue_tracker: true) }
let(:user) { project.owner }
let(:user) { project.first_owner }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) }
let(:zentao_integration) { create(:zentao_integration, project: project) }
......
......@@ -14,7 +14,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::IssueLabelAdded d
let_it_be(:record_with_data) { create(:issue, project: project) }
let_it_be(:record_without_data) { create(:issue) }
let_it_be(:label) { create(:label, project: project) }
let_it_be(:user) { project.owner }
let_it_be(:user) { project.first_owner }
let(:params) { { label: label } }
......
......@@ -14,7 +14,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::IssueLabelRemoved
let_it_be(:label) { create(:label, project: project) }
let_it_be(:record_with_data) { create(:labeled_issue, project: project, labels: [label]) }
let_it_be(:record_without_data) { create(:issue) }
let_it_be(:user) { project.owner }
let_it_be(:user) { project.first_owner }
let(:params) { { label: label } }
......
......@@ -14,7 +14,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::MergeRequestLabel
let_it_be(:record_with_data) { create(:merge_request, :unique_branches, source_project: project) }
let_it_be(:record_without_data) { create(:merge_request) }
let_it_be(:label) { create(:label, project: project) }
let_it_be(:user) { project.owner }
let_it_be(:user) { project.first_owner }
let(:params) { { label: label } }
......
......@@ -14,7 +14,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::MergeRequestLabel
let_it_be(:label) { create(:label, project: project) }
let_it_be(:record_with_data) { create(:labeled_merge_request, :unique_branches, source_project: project, labels: [label]) }
let_it_be(:record_without_data) { create(:merge_request) }
let_it_be(:user) { project.owner }
let_it_be(:user) { project.first_owner }
let(:params) { { label: label } }
......
......@@ -26,7 +26,7 @@ RSpec.describe 'Jobs/Browser-Performance-Testing.gitlab-ci.yml' do
end
let(:project) { project_with_ci_kubernetes_active }
let(:user) { project.owner }
let(:user) { project.first_owner }
let(:default_branch) { 'master' }
let(:pipeline_ref) { default_branch }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_ref) }
......
......@@ -29,7 +29,7 @@ RSpec.describe 'Jobs/DAST-Default-Branch-Deploy.gitlab-ci.yml' do
end
let(:project) { project_with_ci_kubernetes_active }
let(:user) { project.owner }
let(:user) { project.first_owner }
let(:default_branch) { 'master' }
let(:pipeline_ref) { default_branch }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_ref) }
......
......@@ -25,7 +25,7 @@ RSpec.describe 'Jobs/Load-Performance-Testing.gitlab-ci.yml' do
])
end
let(:user) { project.owner }
let(:user) { project.first_owner }
let(:default_branch) { 'master' }
let(:pipeline_ref) { default_branch }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_ref) }
......
......@@ -21,7 +21,7 @@ RSpec.describe 'Verify/Browser-Performance.gitlab-ci.yml' do
describe 'the created pipeline', :clean_gitlab_redis_cache do
let_it_be(:project) { create(:project, :repository) }
let(:user) { project.owner }
let(:user) { project.first_owner }
let(:default_branch) { 'master' }
let(:pipeline_ref) { default_branch }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_ref) }
......
......@@ -21,7 +21,7 @@ RSpec.describe 'Verify/Load-Performance-Testing.gitlab-ci.yml' do
describe 'the created pipeline', :clean_gitlab_redis_cache do
let_it_be(:project) { create(:project, :repository) }
let(:user) { project.owner }
let(:user) { project.first_owner }
let(:default_branch) { 'master' }
let(:pipeline_ref) { default_branch }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_ref) }
......
......@@ -33,7 +33,7 @@ RSpec.describe 'API-Fuzzing.gitlab-ci.yml' do
let(:default_branch) { 'master' }
let(:pipeline_branch) { default_branch }
let(:user) { project.owner }
let(:user) { project.first_owner }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch) }
let(:pipeline) { service.execute!(:push).payload }
let(:build_names) { pipeline.builds.pluck(:name) }
......
......@@ -33,7 +33,7 @@ RSpec.describe 'API-Fuzzing.latest.gitlab-ci.yml' do
let(:default_branch) { 'master' }
let(:pipeline_branch) { default_branch }
let(:user) { project.owner }
let(:user) { project.first_owner }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch) }
let(:pipeline) { service.execute!(:push).payload }
let(:build_names) { pipeline.builds.pluck(:name) }
......
......@@ -9,7 +9,7 @@ RSpec.describe 'Cluster-Image-Scanning.gitlab-ci.yml' do
let_it_be_with_refind(:project) { create(:project, :custom_repo, files: { 'README.txt' => '' }) }
let(:default_branch) { 'master' }
let(:user) { project.owner }
let(:user) { project.first_owner }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: 'master' ) }
let(:pipeline) { service.execute!(:push).payload }
let(:build_names) { pipeline.builds.pluck(:name) }
......
......@@ -9,7 +9,7 @@ RSpec.describe 'Container-Scanning.gitlab-ci.yml' do
let_it_be_with_refind(:project) { create(:project, :custom_repo, files: { 'README.txt' => '' }) }
let(:default_branch) { 'master' }
let(:user) { project.owner }
let(:user) { project.first_owner }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: 'master') }
let(:pipeline) { service.execute!(:push).payload }
let(:build_names) { pipeline.builds.pluck(:name) }
......
......@@ -9,7 +9,7 @@ RSpec.describe 'Coverage-Fuzzing.gitlab-ci.yml' do
let_it_be(:project) { create(:project, :custom_repo, files: { 'README.txt' => '' }) }
let(:default_branch) { 'master' }
let(:user) { project.owner }
let(:user) { project.first_owner }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: 'master' ) }
let(:pipeline) { service.execute!(:push) }
let(:build_names) { pipeline.builds.pluck(:name) }
......
......@@ -33,7 +33,7 @@ RSpec.describe 'DAST-API.gitlab-ci.yml' do
let(:pipeline_branch) { default_branch }
let_it_be(:project) { create(:project, :custom_repo, files: { 'README.txt' => '' }) }
let(:user) { project.owner }
let(:user) { project.first_owner }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch ) }
let(:pipeline) { service.execute!(:push).payload }
let(:build_names) { pipeline.builds.pluck(:name) }
......
......@@ -33,7 +33,7 @@ RSpec.describe 'DAST-API.latest.gitlab-ci.yml' do
let(:pipeline_branch) { default_branch }
let_it_be(:project) { create(:project, :custom_repo, files: { 'README.txt' => '' }) }
let(:user) { project.owner }
let(:user) { project.first_owner }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch ) }
let(:pipeline) { service.execute!(:push).payload }
let(:build_names) { pipeline.builds.pluck(:name) }
......
......@@ -9,7 +9,7 @@ RSpec.describe 'DAST.gitlab-ci.yml' do
let(:default_branch) { project.default_branch_or_main }
let(:pipeline_branch) { default_branch }
let(:project) { create(:project, :custom_repo, files: { 'README.txt' => '' }) }
let(:user) { project.owner }
let(:user) { project.first_owner }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch ) }
let(:pipeline) { service.execute!(:push).payload }
let(:build_names) { pipeline.builds.pluck(:name) }
......
......@@ -21,7 +21,7 @@ RSpec.describe 'DAST.latest.gitlab-ci.yml' do
let(:default_branch) { project.default_branch_or_main }
let(:pipeline_branch) { default_branch }
let(:project) { create(:project, :custom_repo, files: { 'README.txt' => '' }) }
let(:user) { project.owner }
let(:user) { project.first_owner }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch ) }
let(:pipeline) { service.execute!(:push).payload }
let(:build_names) { pipeline.builds.pluck(:name) }
......
......@@ -12,7 +12,7 @@ RSpec.describe 'Secure-Binaries.gitlab-ci.yml' do
let(:default_branch) { project.default_branch_or_main }
let(:pipeline_branch) { default_branch }
let(:user) { project.owner }
let(:user) { project.first_owner }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch ) }
let(:pipeline) { service.execute!(:push).payload }
let(:build_names) { pipeline.builds.pluck(:name) }
......
......@@ -9,7 +9,7 @@ RSpec.describe 'Dependency-Scanning.gitlab-ci.yml' do
let(:default_branch) { 'master' }
let(:files) { { 'README.txt' => '' } }
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: 'master') }
let(:pipeline) { service.execute!(:push).payload }
let(:build_names) { pipeline.builds.pluck(:name) }
......
......@@ -9,7 +9,7 @@ RSpec.describe 'License-Scanning.gitlab-ci.yml' do
let_it_be_with_refind(:project) { create(:project, :custom_repo, files: { 'README.txt' => '' }) }
let(:default_branch) { 'master' }
let(:user) { project.owner }
let(:user) { project.first_owner }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: 'master') }
let(:pipeline) { service.execute!(:push).payload }
let(:build_names) { pipeline.builds.pluck(:name) }
......
......@@ -9,7 +9,7 @@ RSpec.describe 'SAST.gitlab-ci.yml' do
let(:default_branch) { 'master' }
let(:files) { { 'README.txt' => '' } }
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: 'master') }
let(:pipeline) { service.execute!(:push).payload }
let(:build_names) { pipeline.builds.pluck(:name) }
......
......@@ -12,7 +12,7 @@ RSpec.describe 'Secure-Binaries.gitlab-ci.yml' do
let(:default_branch) { project.default_branch_or_main }
let(:pipeline_branch) { default_branch }
let(:user) { project.owner }
let(:user) { project.first_owner }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch ) }
let(:pipeline) { service.execute!(:push).payload }
let(:build_names) { pipeline.builds.pluck(:name) }
......
......@@ -10,7 +10,7 @@ RSpec.describe Gitlab::Elastic::Indexer do
end
let(:project) { create(:project, :repository) }
let(:user) { project.owner }
let(:user) { project.first_owner }
let(:expected_from_sha) { Gitlab::Git::EMPTY_TREE_ID }
let(:to_commit) { project.commit }
......
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