Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
6a536713
Commit
6a536713
authored
Jan 19, 2022
by
charlie ablett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace owner with first_owner in some specs
parent
fd83d464
Changes
47
Hide whitespace changes
Inline
Side-by-side
Showing
47 changed files
with
62 additions
and
57 deletions
+62
-57
app/models/namespace.rb
app/models/namespace.rb
+4
-0
spec/services/branches/delete_merged_service_spec.rb
spec/services/branches/delete_merged_service_spec.rb
+1
-1
spec/services/ci/after_requeue_job_service_spec.rb
spec/services/ci/after_requeue_job_service_spec.rb
+1
-1
spec/services/ci/create_downstream_pipeline_service_spec.rb
spec/services/ci/create_downstream_pipeline_service_spec.rb
+3
-3
spec/services/ci/create_pipeline_service/cache_spec.rb
spec/services/ci/create_pipeline_service/cache_spec.rb
+1
-1
spec/services/ci/create_pipeline_service/creation_errors_and_warnings_spec.rb
...ate_pipeline_service/creation_errors_and_warnings_spec.rb
+1
-1
spec/services/ci/create_pipeline_service/custom_config_content_spec.rb
.../ci/create_pipeline_service/custom_config_content_spec.rb
+1
-1
spec/services/ci/create_pipeline_service/custom_yaml_tags_spec.rb
...vices/ci/create_pipeline_service/custom_yaml_tags_spec.rb
+1
-1
spec/services/ci/create_pipeline_service/dry_run_spec.rb
spec/services/ci/create_pipeline_service/dry_run_spec.rb
+1
-1
spec/services/ci/create_pipeline_service/include_spec.rb
spec/services/ci/create_pipeline_service/include_spec.rb
+1
-1
spec/services/ci/create_pipeline_service/logger_spec.rb
spec/services/ci/create_pipeline_service/logger_spec.rb
+1
-1
spec/services/ci/create_pipeline_service/merge_requests_spec.rb
...ervices/ci/create_pipeline_service/merge_requests_spec.rb
+1
-1
spec/services/ci/create_pipeline_service/needs_spec.rb
spec/services/ci/create_pipeline_service/needs_spec.rb
+1
-1
spec/services/ci/create_pipeline_service/parallel_spec.rb
spec/services/ci/create_pipeline_service/parallel_spec.rb
+1
-1
spec/services/ci/create_pipeline_service/parameter_content_spec.rb
...ices/ci/create_pipeline_service/parameter_content_spec.rb
+1
-1
spec/services/ci/create_pipeline_service/pre_post_stages_spec.rb
...rvices/ci/create_pipeline_service/pre_post_stages_spec.rb
+1
-1
spec/services/ci/create_pipeline_service/rules_spec.rb
spec/services/ci/create_pipeline_service/rules_spec.rb
+1
-1
spec/services/ci/create_pipeline_service/tags_spec.rb
spec/services/ci/create_pipeline_service/tags_spec.rb
+1
-1
spec/services/ci/create_pipeline_service_spec.rb
spec/services/ci/create_pipeline_service_spec.rb
+1
-1
spec/services/ci/destroy_pipeline_service_spec.rb
spec/services/ci/destroy_pipeline_service_spec.rb
+1
-1
spec/services/ci/pipeline_processing/atomic_processing_service_spec.rb
.../ci/pipeline_processing/atomic_processing_service_spec.rb
+2
-2
spec/services/clusters/integrations/create_service_spec.rb
spec/services/clusters/integrations/create_service_spec.rb
+1
-1
spec/services/discussions/update_diff_position_service_spec.rb
...services/discussions/update_diff_position_service_spec.rb
+1
-1
spec/services/feature_flags/hook_service_spec.rb
spec/services/feature_flags/hook_service_spec.rb
+1
-1
spec/services/git/process_ref_changes_service_spec.rb
spec/services/git/process_ref_changes_service_spec.rb
+5
-5
spec/services/integrations/test/project_service_spec.rb
spec/services/integrations/test/project_service_spec.rb
+1
-1
spec/services/members/destroy_service_spec.rb
spec/services/members/destroy_service_spec.rb
+1
-1
spec/services/members/invite_service_spec.rb
spec/services/members/invite_service_spec.rb
+1
-1
spec/services/merge_requests/base_service_spec.rb
spec/services/merge_requests/base_service_spec.rb
+1
-1
spec/services/merge_requests/squash_service_spec.rb
spec/services/merge_requests/squash_service_spec.rb
+1
-1
spec/services/merge_requests/update_service_spec.rb
spec/services/merge_requests/update_service_spec.rb
+1
-1
spec/services/notes/create_service_spec.rb
spec/services/notes/create_service_spec.rb
+1
-1
spec/services/notification_service_spec.rb
spec/services/notification_service_spec.rb
+4
-4
spec/services/projects/create_service_spec.rb
spec/services/projects/create_service_spec.rb
+2
-1
spec/services/projects/destroy_service_spec.rb
spec/services/projects/destroy_service_spec.rb
+1
-1
spec/services/projects/fork_service_spec.rb
spec/services/projects/fork_service_spec.rb
+2
-2
spec/services/projects/repository_languages_service_spec.rb
spec/services/projects/repository_languages_service_spec.rb
+1
-1
spec/services/projects/update_remote_mirror_service_spec.rb
spec/services/projects/update_remote_mirror_service_spec.rb
+1
-1
spec/services/projects/update_service_spec.rb
spec/services/projects/update_service_spec.rb
+1
-1
spec/services/protected_branches/create_service_spec.rb
spec/services/protected_branches/create_service_spec.rb
+1
-1
spec/services/protected_branches/destroy_service_spec.rb
spec/services/protected_branches/destroy_service_spec.rb
+1
-1
spec/services/protected_branches/update_service_spec.rb
spec/services/protected_branches/update_service_spec.rb
+1
-1
spec/services/protected_tags/create_service_spec.rb
spec/services/protected_tags/create_service_spec.rb
+1
-1
spec/services/protected_tags/destroy_service_spec.rb
spec/services/protected_tags/destroy_service_spec.rb
+1
-1
spec/services/protected_tags/update_service_spec.rb
spec/services/protected_tags/update_service_spec.rb
+1
-1
spec/services/test_hooks/system_service_spec.rb
spec/services/test_hooks/system_service_spec.rb
+1
-1
spec/services/users/refresh_authorized_projects_service_spec.rb
...ervices/users/refresh_authorized_projects_service_spec.rb
+1
-1
No files found.
app/models/namespace.rb
View file @
6a536713
...
...
@@ -301,6 +301,10 @@ class Namespace < ApplicationRecord
user_namespace?
end
def
first_owner
owner
end
def
find_fork_of
(
project
)
return
unless
project
.
fork_network
...
...
spec/services/branches/delete_merged_service_spec.rb
View file @
6a536713
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec
.
describe
Branches
::
DeleteMergedService
do
include
ProjectForksHelper
subject
(
:service
)
{
described_class
.
new
(
project
,
project
.
owner
)
}
subject
(
:service
)
{
described_class
.
new
(
project
,
project
.
first_
owner
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
...
...
spec/services/ci/after_requeue_job_service_spec.rb
View file @
6a536713
...
...
@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec
.
describe
Ci
::
AfterRequeueJobService
do
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:user
)
{
project
.
owner
}
let_it_be
(
:user
)
{
project
.
first_
owner
}
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
)
}
...
...
spec/services/ci/create_downstream_pipeline_service_spec.rb
View file @
6a536713
...
...
@@ -604,7 +604,7 @@ RSpec.describe Ci::CreateDownstreamPipelineService, '#execute' do
context
'when configured with bridge job rules'
do
before
do
stub_ci_pipeline_yaml_file
(
config
)
downstream_project
.
add_maintainer
(
upstream_project
.
owner
)
downstream_project
.
add_maintainer
(
upstream_project
.
first_
owner
)
end
let
(
:config
)
do
...
...
@@ -622,13 +622,13 @@ RSpec.describe Ci::CreateDownstreamPipelineService, '#execute' do
end
let
(
:primary_pipeline
)
do
Ci
::
CreatePipelineService
.
new
(
upstream_project
,
upstream_project
.
owner
,
{
ref:
'master'
})
Ci
::
CreatePipelineService
.
new
(
upstream_project
,
upstream_project
.
first_
owner
,
{
ref:
'master'
})
.
execute
(
:push
,
save_on_errors:
false
)
.
payload
end
let
(
:bridge
)
{
primary_pipeline
.
processables
.
find_by
(
name:
'bridge-job'
)
}
let
(
:service
)
{
described_class
.
new
(
upstream_project
,
upstream_project
.
owner
)
}
let
(
:service
)
{
described_class
.
new
(
upstream_project
,
upstream_project
.
first_
owner
)
}
context
'that include the bridge job'
do
it
'creates the downstream pipeline'
do
...
...
spec/services/ci/create_pipeline_service/cache_spec.rb
View file @
6a536713
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec
.
describe
Ci
::
CreatePipelineService
do
context
'cache'
do
let
(
:project
)
{
create
(
:project
,
:custom_repo
,
files:
files
)
}
let
(
:user
)
{
project
.
owner
}
let
(
:user
)
{
project
.
first_
owner
}
let
(
:ref
)
{
'refs/heads/master'
}
let
(
:source
)
{
:push
}
let
(
:service
)
{
described_class
.
new
(
project
,
user
,
{
ref:
ref
})
}
...
...
spec/services/ci/create_pipeline_service/creation_errors_and_warnings_spec.rb
View file @
6a536713
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec
.
describe
Ci
::
CreatePipelineService
do
describe
'creation errors and warnings'
do
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:user
)
{
project
.
owner
}
let_it_be
(
:user
)
{
project
.
first_
owner
}
let
(
:ref
)
{
'refs/heads/master'
}
let
(
:source
)
{
:push
}
...
...
spec/services/ci/create_pipeline_service/custom_config_content_spec.rb
View file @
6a536713
...
...
@@ -3,7 +3,7 @@ require 'spec_helper'
RSpec
.
describe
Ci
::
CreatePipelineService
do
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:user
)
{
project
.
owner
}
let_it_be
(
:user
)
{
project
.
first_
owner
}
let
(
:ref
)
{
'refs/heads/master'
}
let
(
:service
)
{
described_class
.
new
(
project
,
user
,
{
ref:
ref
})
}
...
...
spec/services/ci/create_pipeline_service/custom_yaml_tags_spec.rb
View file @
6a536713
...
...
@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec
.
describe
Ci
::
CreatePipelineService
do
describe
'!reference tags'
do
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:user
)
{
project
.
owner
}
let_it_be
(
:user
)
{
project
.
first_
owner
}
let
(
:ref
)
{
'refs/heads/master'
}
let
(
:source
)
{
:push
}
...
...
spec/services/ci/create_pipeline_service/dry_run_spec.rb
View file @
6a536713
...
...
@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec
.
describe
Ci
::
CreatePipelineService
do
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:user
)
{
project
.
owner
}
let_it_be
(
:user
)
{
project
.
first_
owner
}
let
(
:ref
)
{
'refs/heads/master'
}
let
(
:service
)
{
described_class
.
new
(
project
,
user
,
{
ref:
ref
})
}
...
...
spec/services/ci/create_pipeline_service/include_spec.rb
View file @
6a536713
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec
.
describe
Ci
::
CreatePipelineService
do
context
'include:'
do
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:user
)
{
project
.
owner
}
let_it_be
(
:user
)
{
project
.
first_
owner
}
let
(
:ref
)
{
'refs/heads/master'
}
let
(
:variables_attributes
)
{
[{
key:
'MYVAR'
,
secret_value:
'hello'
}]
}
...
...
spec/services/ci/create_pipeline_service/logger_spec.rb
View file @
6a536713
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec
.
describe
Ci
::
CreatePipelineService
do
context
'pipeline logger'
do
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:user
)
{
project
.
owner
}
let_it_be
(
:user
)
{
project
.
first_
owner
}
let
(
:ref
)
{
'refs/heads/master'
}
let
(
:service
)
{
described_class
.
new
(
project
,
user
,
{
ref:
ref
})
}
...
...
spec/services/ci/create_pipeline_service/merge_requests_spec.rb
View file @
6a536713
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec
.
describe
Ci
::
CreatePipelineService
do
context
'merge requests handling'
do
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:user
)
{
project
.
owner
}
let_it_be
(
:user
)
{
project
.
first_
owner
}
let
(
:ref
)
{
'refs/heads/feature'
}
let
(
:source
)
{
:push
}
...
...
spec/services/ci/create_pipeline_service/needs_spec.rb
View file @
6a536713
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec
.
describe
Ci
::
CreatePipelineService
do
context
'needs'
do
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:user
)
{
project
.
owner
}
let_it_be
(
:user
)
{
project
.
first_
owner
}
let
(
:ref
)
{
'refs/heads/master'
}
let
(
:source
)
{
:push
}
...
...
spec/services/ci/create_pipeline_service/parallel_spec.rb
View file @
6a536713
...
...
@@ -3,7 +3,7 @@ require 'spec_helper'
RSpec
.
describe
Ci
::
CreatePipelineService
do
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:user
)
{
project
.
owner
}
let_it_be
(
:user
)
{
project
.
first_
owner
}
let
(
:service
)
{
described_class
.
new
(
project
,
user
,
{
ref:
'master'
})
}
let
(
:pipeline
)
{
service
.
execute
(
:push
).
payload
}
...
...
spec/services/ci/create_pipeline_service/parameter_content_spec.rb
View file @
6a536713
...
...
@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec
.
describe
Ci
::
CreatePipelineService
do
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:user
)
{
project
.
owner
}
let_it_be
(
:user
)
{
project
.
first_
owner
}
let
(
:service
)
{
described_class
.
new
(
project
,
user
,
{
ref:
'refs/heads/master'
})
}
let
(
:content
)
do
...
...
spec/services/ci/create_pipeline_service/pre_post_stages_spec.rb
View file @
6a536713
...
...
@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec
.
describe
Ci
::
CreatePipelineService
do
describe
'.pre/.post stages'
do
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:user
)
{
project
.
owner
}
let_it_be
(
:user
)
{
project
.
first_
owner
}
let
(
:source
)
{
:push
}
let
(
:service
)
{
described_class
.
new
(
project
,
user
,
{
ref:
ref
})
}
...
...
spec/services/ci/create_pipeline_service/rules_spec.rb
View file @
6a536713
...
...
@@ -3,7 +3,7 @@ require 'spec_helper'
RSpec
.
describe
Ci
::
CreatePipelineService
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:user
)
{
project
.
owner
}
let
(
:user
)
{
project
.
first_
owner
}
let
(
:ref
)
{
'refs/heads/master'
}
let
(
:source
)
{
:push
}
let
(
:service
)
{
described_class
.
new
(
project
,
user
,
{
ref:
ref
})
}
...
...
spec/services/ci/create_pipeline_service/tags_spec.rb
View file @
6a536713
...
...
@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec
.
describe
Ci
::
CreatePipelineService
do
describe
'tags:'
do
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:user
)
{
project
.
owner
}
let_it_be
(
:user
)
{
project
.
first_
owner
}
let
(
:ref
)
{
'refs/heads/master'
}
let
(
:service
)
{
described_class
.
new
(
project
,
user
,
{
ref:
ref
})
}
...
...
spec/services/ci/create_pipeline_service_spec.rb
View file @
6a536713
...
...
@@ -6,7 +6,7 @@ RSpec.describe Ci::CreatePipelineService do
include
ProjectForksHelper
let_it_be_with_refind
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be_with_reload
(
:user
)
{
project
.
owner
}
let_it_be_with_reload
(
:user
)
{
project
.
first_
owner
}
let
(
:ref_name
)
{
'refs/heads/master'
}
...
...
spec/services/ci/destroy_pipeline_service_spec.rb
View file @
6a536713
...
...
@@ -10,7 +10,7 @@ RSpec.describe ::Ci::DestroyPipelineService do
subject
{
described_class
.
new
(
project
,
user
).
execute
(
pipeline
)
}
context
'user is owner'
do
let
(
:user
)
{
project
.
owner
}
let
(
:user
)
{
project
.
first_
owner
}
it
'destroys the pipeline'
do
subject
...
...
spec/services/ci/pipeline_processing/atomic_processing_service_spec.rb
View file @
6a536713
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec
.
describe
Ci
::
PipelineProcessing
::
AtomicProcessingService
do
describe
'Pipeline Processing Service Tests With Yaml'
do
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:user
)
{
project
.
owner
}
let_it_be
(
:user
)
{
project
.
first_
owner
}
where
(
:test_file_path
)
do
Dir
.
glob
(
Rails
.
root
.
join
(
'spec/services/ci/pipeline_processing/test_cases/*.yml'
))
...
...
@@ -65,7 +65,7 @@ RSpec.describe Ci::PipelineProcessing::AtomicProcessingService do
describe
'Pipeline Processing Service'
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:user
)
{
project
.
owner
}
let
(
:user
)
{
project
.
first_
owner
}
let
(
:pipeline
)
do
create
(
:ci_empty_pipeline
,
ref:
'master'
,
project:
project
)
...
...
spec/services/clusters/integrations/create_service_spec.rb
View file @
6a536713
...
...
@@ -7,7 +7,7 @@ RSpec.describe Clusters::Integrations::CreateService, '#execute' do
let_it_be_with_reload
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
}
let
(
:service
)
do
described_class
.
new
(
container:
project
,
cluster:
cluster
,
current_user:
project
.
owner
,
params:
params
)
described_class
.
new
(
container:
project
,
cluster:
cluster
,
current_user:
project
.
first_
owner
,
params:
params
)
end
shared_examples_for
'a cluster integration'
do
|
application_type
|
...
...
spec/services/discussions/update_diff_position_service_spec.rb
View file @
6a536713
...
...
@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec
.
describe
Discussions
::
UpdateDiffPositionService
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:current_user
)
{
project
.
owner
}
let
(
:current_user
)
{
project
.
first_
owner
}
let
(
:create_commit
)
{
project
.
commit
(
"913c66a37b4a45b9769037c55c2d238bd0942d2e"
)
}
let
(
:modify_commit
)
{
project
.
commit
(
"874797c3a73b60d2187ed6e2fcabd289ff75171e"
)
}
let
(
:edit_commit
)
{
project
.
commit
(
"570e7b2abdd848b95f2f578043fc23bd6f6fd24d"
)
}
...
...
spec/services/feature_flags/hook_service_spec.rb
View file @
6a536713
...
...
@@ -7,7 +7,7 @@ RSpec.describe FeatureFlags::HookService do
let_it_be
(
:namespace
)
{
create
(
:namespace
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
,
namespace:
namespace
)
}
let_it_be
(
:feature_flag
)
{
create
(
:operations_feature_flag
,
project:
project
)
}
let_it_be
(
:user
)
{
namespace
.
owner
}
let_it_be
(
:user
)
{
namespace
.
first_
owner
}
let!
(
:hook
)
{
create
(
:project_hook
,
project:
project
)
}
let
(
:hook_data
)
{
double
}
...
...
spec/services/git/process_ref_changes_service_spec.rb
View file @
6a536713
...
...
@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec
.
describe
Git
::
ProcessRefChangesService
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:user
)
{
project
.
owner
}
let
(
:user
)
{
project
.
first_
owner
}
let
(
:params
)
{
{
changes:
git_changes
}
}
subject
{
described_class
.
new
(
project
,
user
,
params
)
}
...
...
@@ -34,7 +34,7 @@ RSpec.describe Git::ProcessRefChangesService do
it
"calls
#{
push_service_class
}
"
do
expect
(
push_service_class
)
.
to
receive
(
:new
)
.
with
(
project
,
project
.
owner
,
hash_including
(
execute_project_hooks:
true
,
create_push_event:
true
))
.
with
(
project
,
project
.
first_
owner
,
hash_including
(
execute_project_hooks:
true
,
create_push_event:
true
))
.
exactly
(
changes
.
count
).
times
.
and_return
(
service
)
...
...
@@ -58,7 +58,7 @@ RSpec.describe Git::ProcessRefChangesService do
it
"calls
#{
push_service_class
}
with execute_project_hooks set to false"
do
expect
(
push_service_class
)
.
to
receive
(
:new
)
.
with
(
project
,
project
.
owner
,
hash_including
(
execute_project_hooks:
false
))
.
with
(
project
,
project
.
first_
owner
,
hash_including
(
execute_project_hooks:
false
))
.
exactly
(
changes
.
count
).
times
.
and_return
(
service
)
...
...
@@ -86,7 +86,7 @@ RSpec.describe Git::ProcessRefChangesService do
it
"calls
#{
push_service_class
}
with create_push_event set to false"
do
expect
(
push_service_class
)
.
to
receive
(
:new
)
.
with
(
project
,
project
.
owner
,
hash_including
(
create_push_event:
false
))
.
with
(
project
,
project
.
first_
owner
,
hash_including
(
create_push_event:
false
))
.
exactly
(
changes
.
count
).
times
.
and_return
(
service
)
...
...
@@ -170,7 +170,7 @@ RSpec.describe Git::ProcessRefChangesService do
allow
(
push_service_class
)
.
to
receive
(
:new
)
.
with
(
project
,
project
.
owner
,
hash_including
(
execute_project_hooks:
true
,
create_push_event:
true
))
.
with
(
project
,
project
.
first_
owner
,
hash_including
(
execute_project_hooks:
true
,
create_push_event:
true
))
.
exactly
(
changes
.
count
).
times
.
and_return
(
service
)
end
...
...
spec/services/integrations/test/project_service_spec.rb
View file @
6a536713
...
...
@@ -9,7 +9,7 @@ RSpec.describe Integrations::Test::ProjectService do
let_it_be
(
:project
)
{
create
(
:project
)
}
let
(
:integration
)
{
create
(
:integrations_slack
,
project:
project
)
}
let
(
:user
)
{
project
.
owner
}
let
(
:user
)
{
project
.
first_
owner
}
let
(
:event
)
{
nil
}
let
(
:sample_data
)
{
{
data:
'sample'
}
}
let
(
:success_result
)
{
{
success:
true
,
result:
{}
}
}
...
...
spec/services/members/destroy_service_spec.rb
View file @
6a536713
...
...
@@ -424,7 +424,7 @@ RSpec.describe Members::DestroyService do
end
context
'deletion of invitations created by deleted project member'
do
let
(
:user
)
{
project
.
owner
}
let
(
:user
)
{
project
.
first_
owner
}
let
(
:member_user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
...
...
spec/services/members/invite_service_spec.rb
View file @
6a536713
...
...
@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec
.
describe
Members
::
InviteService
,
:aggregate_failures
,
:clean_gitlab_redis_shared_state
,
:sidekiq_inline
do
let_it_be
(
:project
,
reload:
true
)
{
create
(
:project
)
}
let_it_be
(
:user
)
{
project
.
owner
}
let_it_be
(
:user
)
{
project
.
first_
owner
}
let_it_be
(
:project_user
)
{
create
(
:user
)
}
let_it_be
(
:namespace
)
{
project
.
namespace
}
...
...
spec/services/merge_requests/base_service_spec.rb
View file @
6a536713
...
...
@@ -17,7 +17,7 @@ RSpec.describe MergeRequests::BaseService do
}
end
subject
{
MergeRequests
::
CreateService
.
new
(
project:
project
,
current_user:
project
.
owner
,
params:
params
)
}
subject
{
MergeRequests
::
CreateService
.
new
(
project:
project
,
current_user:
project
.
first_
owner
,
params:
params
)
}
describe
'#execute_hooks'
do
shared_examples
'enqueues Jira sync worker'
do
...
...
spec/services/merge_requests/squash_service_spec.rb
View file @
6a536713
...
...
@@ -6,7 +6,7 @@ RSpec.describe MergeRequests::SquashService do
include
GitHelpers
let
(
:service
)
{
described_class
.
new
(
project:
project
,
current_user:
user
,
params:
{
merge_request:
merge_request
})
}
let
(
:user
)
{
project
.
owner
}
let
(
:user
)
{
project
.
first_
owner
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:repository
)
{
project
.
repository
.
raw
}
let
(
:log_error
)
{
"Failed to squash merge request
#{
merge_request
.
to_reference
(
full:
true
)
}
:"
}
...
...
spec/services/merge_requests/update_service_spec.rb
View file @
6a536713
...
...
@@ -1132,7 +1132,7 @@ RSpec.describe MergeRequests::UpdateService, :mailer do
context
'updating `force_remove_source_branch`'
do
let
(
:target_project
)
{
create
(
:project
,
:repository
,
:public
)
}
let
(
:source_project
)
{
fork_project
(
target_project
,
nil
,
repository:
true
)
}
let
(
:user
)
{
target_project
.
owner
}
let
(
:user
)
{
target_project
.
first_
owner
}
let
(
:merge_request
)
do
create
(
:merge_request
,
source_project:
source_project
,
...
...
spec/services/notes/create_service_spec.rb
View file @
6a536713
...
...
@@ -402,7 +402,7 @@ RSpec.describe Notes::CreateService do
let_it_be
(
:design
)
{
create
(
:design
,
:with_file
)
}
let_it_be
(
:project
)
{
design
.
project
}
let_it_be
(
:user
)
{
project
.
owner
}
let_it_be
(
:user
)
{
project
.
first_
owner
}
let_it_be
(
:params
)
do
{
type:
'DiffNote'
,
...
...
spec/services/notification_service_spec.rb
View file @
6a536713
...
...
@@ -2885,7 +2885,7 @@ RSpec.describe NotificationService, :mailer do
let
(
:member
)
{
create
(
:user
)
}
before
do
project
.
add_developer
(
member
,
current_user:
project
.
owner
)
project
.
add_developer
(
member
,
current_user:
project
.
first_
owner
)
end
it
do
...
...
@@ -3287,7 +3287,7 @@ RSpec.describe NotificationService, :mailer do
let_it_be
(
:domain
,
reload:
true
)
{
create
(
:pages_domain
,
project:
project
)
}
let_it_be
(
:u_blocked
)
{
create
(
:user
,
:blocked
)
}
let_it_be
(
:u_silence
)
{
create_user_with_notification
(
:disabled
,
'silent'
,
project
)
}
let_it_be
(
:u_owner
)
{
project
.
owner
}
let_it_be
(
:u_owner
)
{
project
.
first_
owner
}
let_it_be
(
:u_maintainer1
)
{
create
(
:user
)
}
let_it_be
(
:u_maintainer2
)
{
create
(
:user
)
}
let_it_be
(
:u_developer
)
{
create
(
:user
)
}
...
...
@@ -3395,7 +3395,7 @@ RSpec.describe NotificationService, :mailer do
let
(
:remote_mirror
)
{
create
(
:remote_mirror
,
project:
project
)
}
let
(
:u_blocked
)
{
create
(
:user
,
:blocked
)
}
let
(
:u_silence
)
{
create_user_with_notification
(
:disabled
,
'silent-maintainer'
,
project
)
}
let
(
:u_owner
)
{
project
.
owner
}
let
(
:u_owner
)
{
project
.
first_
owner
}
let
(
:u_maintainer1
)
{
create
(
:user
)
}
let
(
:u_maintainer2
)
{
create
(
:user
)
}
let
(
:u_developer
)
{
create
(
:user
)
}
...
...
@@ -3489,7 +3489,7 @@ RSpec.describe NotificationService, :mailer do
it
'sends the email to owners and masters'
do
expect
(
Notify
).
to
receive
(
:prometheus_alert_fired_email
).
with
(
project
,
master
,
alert
).
and_call_original
expect
(
Notify
).
to
receive
(
:prometheus_alert_fired_email
).
with
(
project
,
project
.
owner
,
alert
).
and_call_original
expect
(
Notify
).
to
receive
(
:prometheus_alert_fired_email
).
with
(
project
,
project
.
first_
owner
,
alert
).
and_call_original
expect
(
Notify
).
not_to
receive
(
:prometheus_alert_fired_email
).
with
(
project
,
developer
,
alert
)
subject
.
prometheus_alerts_fired
(
project
,
[
alert
])
...
...
spec/services/projects/create_service_spec.rb
View file @
6a536713
...
...
@@ -119,7 +119,7 @@ RSpec.describe Projects::CreateService, '#execute' do
project
=
create_project
(
user
,
opts
)
expect
(
project
).
to
be_valid
expect
(
project
.
owner
).
to
eq
(
user
)
expect
(
project
.
first_
owner
).
to
eq
(
user
)
expect
(
project
.
team
.
maintainers
).
to
include
(
user
)
expect
(
project
.
namespace
).
to
eq
(
user
.
namespace
)
expect
(
project
.
project_namespace
).
to
be_in_sync_with_project
(
project
)
...
...
@@ -154,6 +154,7 @@ RSpec.describe Projects::CreateService, '#execute' do
expect
(
project
).
to
be_persisted
expect
(
project
.
owner
).
to
eq
(
user
)
expect
(
project
.
first_owner
).
to
eq
(
user
)
expect
(
project
.
team
.
maintainers
).
to
contain_exactly
(
user
)
expect
(
project
.
namespace
).
to
eq
(
user
.
namespace
)
expect
(
project
.
project_namespace
).
to
be_in_sync_with_project
(
project
)
...
...
spec/services/projects/destroy_service_spec.rb
View file @
6a536713
...
...
@@ -64,7 +64,7 @@ RSpec.describe Projects::DestroyService, :aggregate_failures do
create
(
:ci_pipeline_artifact
,
pipeline:
pipeline
)
create_list
(
:ci_build_trace_chunk
,
3
,
build:
builds
[
0
])
expect
{
destroy_project
(
project
,
project
.
owner
,
{})
}.
not_to
exceed_query_limit
(
recorder
)
expect
{
destroy_project
(
project
,
project
.
first_
owner
,
{})
}.
not_to
exceed_query_limit
(
recorder
)
end
it_behaves_like
'deleting the project'
...
...
spec/services/projects/fork_service_spec.rb
View file @
6a536713
...
...
@@ -61,7 +61,7 @@ RSpec.describe Projects::ForkService do
it
{
expect
(
to_project
).
to
be_persisted
}
it
{
expect
(
to_project
.
errors
).
to
be_empty
}
it
{
expect
(
to_project
.
owner
).
to
eq
(
@to_user
)
}
it
{
expect
(
to_project
.
first_
owner
).
to
eq
(
@to_user
)
}
it
{
expect
(
to_project
.
namespace
).
to
eq
(
@to_user
.
namespace
)
}
it
{
expect
(
to_project
.
star_count
).
to
be_zero
}
it
{
expect
(
to_project
.
description
).
to
eq
(
@from_project
.
description
)
}
...
...
@@ -274,7 +274,7 @@ RSpec.describe Projects::ForkService do
expect
(
to_project
).
to
be_persisted
expect
(
to_project
.
errors
).
to
be_empty
expect
(
to_project
.
owner
).
to
eq
(
@group
)
expect
(
to_project
.
first_owner
).
to
eq
(
@group_owner
)
expect
(
to_project
.
namespace
).
to
eq
(
@group
)
expect
(
to_project
.
name
).
to
eq
(
@project
.
name
)
expect
(
to_project
.
path
).
to
eq
(
@project
.
path
)
...
...
spec/services/projects/repository_languages_service_spec.rb
View file @
6a536713
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
RSpec
.
describe
Projects
::
RepositoryLanguagesService
do
let
(
:service
)
{
described_class
.
new
(
project
,
project
.
owner
)
}
let
(
:service
)
{
described_class
.
new
(
project
,
project
.
first_
owner
)
}
context
'when detected_repository_languages flag is set'
do
let
(
:project
)
{
create
(
:project
)
}
...
...
spec/services/projects/update_remote_mirror_service_spec.rb
View file @
6a536713
...
...
@@ -15,7 +15,7 @@ RSpec.describe Projects::UpdateRemoteMirrorService do
subject
(
:execute!
)
{
service
.
execute
(
remote_mirror
,
retries
)
}
before
do
project
.
repository
.
add_branch
(
project
.
owner
,
'existing-branch'
,
'master'
)
project
.
repository
.
add_branch
(
project
.
first_
owner
,
'existing-branch'
,
'master'
)
allow
(
remote_mirror
)
.
to
receive
(
:update_repository
)
...
...
spec/services/projects/update_service_spec.rb
View file @
6a536713
...
...
@@ -149,7 +149,7 @@ RSpec.describe Projects::UpdateService do
describe
'when updating project that has forks'
do
let
(
:project
)
{
create
(
:project
,
:internal
)
}
let
(
:user
)
{
project
.
owner
}
let
(
:user
)
{
project
.
first_
owner
}
let
(
:forked_project
)
{
fork_project
(
project
)
}
context
'and unlink forks feature flag is off'
do
...
...
spec/services/protected_branches/create_service_spec.rb
View file @
6a536713
...
...
@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec
.
describe
ProtectedBranches
::
CreateService
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:user
)
{
project
.
owner
}
let
(
:user
)
{
project
.
first_
owner
}
let
(
:params
)
do
{
name:
name
,
...
...
spec/services/protected_branches/destroy_service_spec.rb
View file @
6a536713
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec
.
describe
ProtectedBranches
::
DestroyService
do
let
(
:protected_branch
)
{
create
(
:protected_branch
)
}
let
(
:project
)
{
protected_branch
.
project
}
let
(
:user
)
{
project
.
owner
}
let
(
:user
)
{
project
.
first_
owner
}
describe
'#execute'
do
subject
(
:service
)
{
described_class
.
new
(
project
,
user
)
}
...
...
spec/services/protected_branches/update_service_spec.rb
View file @
6a536713
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec
.
describe
ProtectedBranches
::
UpdateService
do
let
(
:protected_branch
)
{
create
(
:protected_branch
)
}
let
(
:project
)
{
protected_branch
.
project
}
let
(
:user
)
{
project
.
owner
}
let
(
:user
)
{
project
.
first_
owner
}
let
(
:params
)
{
{
name:
new_name
}
}
describe
'#execute'
do
...
...
spec/services/protected_tags/create_service_spec.rb
View file @
6a536713
...
...
@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec
.
describe
ProtectedTags
::
CreateService
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:user
)
{
project
.
owner
}
let
(
:user
)
{
project
.
first_
owner
}
let
(
:params
)
do
{
name:
name
,
...
...
spec/services/protected_tags/destroy_service_spec.rb
View file @
6a536713
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec
.
describe
ProtectedTags
::
DestroyService
do
let
(
:protected_tag
)
{
create
(
:protected_tag
)
}
let
(
:project
)
{
protected_tag
.
project
}
let
(
:user
)
{
project
.
owner
}
let
(
:user
)
{
project
.
first_
owner
}
describe
'#execute'
do
subject
(
:service
)
{
described_class
.
new
(
project
,
user
)
}
...
...
spec/services/protected_tags/update_service_spec.rb
View file @
6a536713
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec
.
describe
ProtectedTags
::
UpdateService
do
let
(
:protected_tag
)
{
create
(
:protected_tag
)
}
let
(
:project
)
{
protected_tag
.
project
}
let
(
:user
)
{
project
.
owner
}
let
(
:user
)
{
project
.
first_
owner
}
let
(
:params
)
{
{
name:
new_name
}
}
describe
'#execute'
do
...
...
spec/services/test_hooks/system_service_spec.rb
View file @
6a536713
...
...
@@ -9,7 +9,7 @@ RSpec.describe TestHooks::SystemService do
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:hook
)
{
create
(
:system_hook
)
}
let
(
:service
)
{
described_class
.
new
(
hook
,
project
.
owner
,
trigger
)
}
let
(
:service
)
{
described_class
.
new
(
hook
,
project
.
first_
owner
,
trigger
)
}
let
(
:success_result
)
{
{
status: :success
,
http_status:
200
,
message:
'ok'
}
}
before
do
...
...
spec/services/users/refresh_authorized_projects_service_spec.rb
View file @
6a536713
...
...
@@ -9,7 +9,7 @@ RSpec.describe Users::RefreshAuthorizedProjectsService do
# triggered twice.
let!
(
:project
)
{
create
(
:project
)
}
let
(
:user
)
{
project
.
namespace
.
owner
}
let
(
:user
)
{
project
.
namespace
.
first_
owner
}
let
(
:service
)
{
described_class
.
new
(
user
)
}
describe
'#execute'
,
:clean_gitlab_redis_shared_state
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment