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
0cd315eb
Commit
0cd315eb
authored
Jan 26, 2022
by
charlie ablett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace owner with first_owner in EE specs
parent
99be341f
Changes
44
Hide whitespace changes
Inline
Side-by-side
Showing
44 changed files
with
73 additions
and
73 deletions
+73
-73
ee/spec/models/ee/project_group_link_spec.rb
ee/spec/models/ee/project_group_link_spec.rb
+2
-2
ee/spec/models/instance_security_dashboard_spec.rb
ee/spec/models/instance_security_dashboard_spec.rb
+1
-1
ee/spec/models/productivity_analytics_spec.rb
ee/spec/models/productivity_analytics_spec.rb
+1
-1
ee/spec/models/project_spec.rb
ee/spec/models/project_spec.rb
+1
-1
ee/spec/models/security/orchestration_policy_configuration_spec.rb
...odels/security/orchestration_policy_configuration_spec.rb
+2
-2
ee/spec/presenters/ee/blob_presenter_spec.rb
ee/spec/presenters/ee/blob_presenter_spec.rb
+1
-1
ee/spec/requests/api/api_spec.rb
ee/spec/requests/api/api_spec.rb
+1
-1
ee/spec/requests/api/ci/pipelines_spec.rb
ee/spec/requests/api/ci/pipelines_spec.rb
+1
-1
ee/spec/requests/api/graphql/mutations/projects/set_compliance_framework_spec.rb
...aphql/mutations/projects/set_compliance_framework_spec.rb
+1
-1
ee/spec/requests/api/status_checks_spec.rb
ee/spec/requests/api/status_checks_spec.rb
+11
-11
ee/spec/requests/projects/audit_events_spec.rb
ee/spec/requests/projects/audit_events_spec.rb
+1
-1
ee/spec/services/ci/create_pipeline_service/compliance_spec.rb
...ec/services/ci/create_pipeline_service/compliance_spec.rb
+2
-2
ee/spec/services/ci/create_pipeline_service/cross_needs_artifacts_spec.rb
.../ci/create_pipeline_service/cross_needs_artifacts_spec.rb
+1
-1
ee/spec/services/ci/create_pipeline_service/needs_spec.rb
ee/spec/services/ci/create_pipeline_service/needs_spec.rb
+1
-1
ee/spec/services/ci/create_pipeline_service/runnable_builds_spec.rb
...rvices/ci/create_pipeline_service/runnable_builds_spec.rb
+1
-1
ee/spec/services/ci/destroy_pipeline_service_spec.rb
ee/spec/services/ci/destroy_pipeline_service_spec.rb
+1
-1
ee/spec/services/ee/ci/pipeline_processing/atomic_processing_service_spec.rb
.../ci/pipeline_processing/atomic_processing_service_spec.rb
+1
-1
ee/spec/services/ee/integrations/test/project_service_spec.rb
...pec/services/ee/integrations/test/project_service_spec.rb
+1
-1
ee/spec/services/ee/merge_requests/base_service_spec.rb
ee/spec/services/ee/merge_requests/base_service_spec.rb
+2
-2
ee/spec/services/ee/merge_requests/create_service_spec.rb
ee/spec/services/ee/merge_requests/create_service_spec.rb
+1
-1
ee/spec/services/ee/notification_service_spec.rb
ee/spec/services/ee/notification_service_spec.rb
+9
-9
ee/spec/services/ee/protected_branches/create_service_spec.rb
...pec/services/ee/protected_branches/create_service_spec.rb
+1
-1
ee/spec/services/ee/protected_branches/destroy_service_spec.rb
...ec/services/ee/protected_branches/destroy_service_spec.rb
+1
-1
ee/spec/services/ee/protected_branches/update_service_spec.rb
...pec/services/ee/protected_branches/update_service_spec.rb
+1
-1
ee/spec/services/ee/users/destroy_service_spec.rb
ee/spec/services/ee/users/destroy_service_spec.rb
+1
-1
ee/spec/services/external_status_checks/create_service_spec.rb
...ec/services/external_status_checks/create_service_spec.rb
+1
-1
ee/spec/services/external_status_checks/destroy_service_spec.rb
...c/services/external_status_checks/destroy_service_spec.rb
+1
-1
ee/spec/services/external_status_checks/update_service_spec.rb
...ec/services/external_status_checks/update_service_spec.rb
+1
-1
ee/spec/services/merge_requests/update_blocks_service_spec.rb
...pec/services/merge_requests/update_blocks_service_spec.rb
+1
-1
ee/spec/services/projects/destroy_service_spec.rb
ee/spec/services/projects/destroy_service_spec.rb
+1
-1
ee/spec/services/projects/update_mirror_service_spec.rb
ee/spec/services/projects/update_mirror_service_spec.rb
+3
-3
ee/spec/services/search/project_service_spec.rb
ee/spec/services/search/project_service_spec.rb
+1
-1
ee/spec/services/security/security_orchestration_policies/create_pipeline_service_spec.rb
...ty_orchestration_policies/create_pipeline_service_spec.rb
+1
-1
ee/spec/services/security/security_orchestration_policies/policy_commit_service_spec.rb
...rity_orchestration_policies/policy_commit_service_spec.rb
+1
-1
ee/spec/services/security/security_orchestration_policies/process_scan_result_policy_service_spec.rb
...ation_policies/process_scan_result_policy_service_spec.rb
+2
-2
ee/spec/services/security/security_orchestration_policies/project_create_service_spec.rb
...ity_orchestration_policies/project_create_service_spec.rb
+2
-2
ee/spec/services/security/store_report_service_spec.rb
ee/spec/services/security/store_report_service_spec.rb
+1
-1
ee/spec/support/shared_contexts/graphql/resolvers/security_orchestration/resolves_orchestration_policy_shared_contexts.rb
...stration/resolves_orchestration_policy_shared_contexts.rb
+1
-1
ee/spec/support/shared_examples/quick_actions/issue/status_page_quick_actions_shared_examples.rb
...ctions/issue/status_page_quick_actions_shared_examples.rb
+1
-1
ee/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
ee/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
+3
-3
ee/spec/views/projects/security/policies/index.html.haml_spec.rb
.../views/projects/security/policies/index.html.haml_spec.rb
+1
-1
ee/spec/views/shared/_mirror_status.html.haml_spec.rb
ee/spec/views/shared/_mirror_status.html.haml_spec.rb
+1
-1
ee/spec/views/shared/_mirror_update_button.html.haml_spec.rb
ee/spec/views/shared/_mirror_update_button.html.haml_spec.rb
+1
-1
ee/spec/workers/post_receive_spec.rb
ee/spec/workers/post_receive_spec.rb
+2
-2
No files found.
ee/spec/models/ee/project_group_link_spec.rb
View file @
0cd315eb
...
...
@@ -25,7 +25,7 @@ RSpec.describe ProjectGroupLink do
let!
(
:protected_tag
)
do
ProtectedTags
::
CreateService
.
new
(
project
,
project
.
owner
,
project
.
first_
owner
,
attributes_for
(
:protected_tag
,
create_access_levels_attributes:
[{
group_id:
group
.
id
},
{
user_id:
user
.
id
}]
...
...
@@ -42,7 +42,7 @@ RSpec.describe ProjectGroupLink do
let!
(
:protected_environment
)
do
ProtectedEnvironments
::
CreateService
.
new
(
container:
project
,
current_user:
project
.
owner
,
current_user:
project
.
first_
owner
,
params:
attributes_for
(
:protected_environment
,
deploy_access_levels_attributes:
[{
group_id:
group
.
id
},
{
user_id:
user
.
id
}]
...
...
ee/spec/models/instance_security_dashboard_spec.rb
View file @
0cd315eb
...
...
@@ -113,7 +113,7 @@ RSpec.describe InstanceSecurityDashboard do
context
'when the user is not an auditor'
do
context
'when the user is project owner'
do
let
(
:user
)
{
project1
.
owner
}
let
(
:user
)
{
project1
.
first_
owner
}
it_behaves_like
'project permissions'
do
let
(
:expected_projects
)
{
project1
}
...
...
ee/spec/models/productivity_analytics_spec.rb
View file @
0cd315eb
...
...
@@ -7,7 +7,7 @@ RSpec.describe ProductivityAnalytics do
subject
(
:analytics
)
{
described_class
.
new
(
merge_requests:
finder_mrs
,
sort:
custom_sort
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:user
)
{
project
.
owner
}
let
(
:user
)
{
project
.
first_
owner
}
let
(
:finder_mrs
)
{
ProductivityAnalyticsFinder
.
new
(
user
,
finder_options
).
execute
}
let
(
:finder_options
)
{
{
state:
'merged'
}
}
...
...
ee/spec/models/project_spec.rb
View file @
0cd315eb
...
...
@@ -2839,7 +2839,7 @@ RSpec.describe Project do
expect
(
project
).
to
receive
(
:create_import_state
)
project
.
update!
(
mirror:
true
,
mirror_user:
project
.
owner
,
import_url:
'http://foo.com'
)
project
.
update!
(
mirror:
true
,
mirror_user:
project
.
first_
owner
,
import_url:
'http://foo.com'
)
end
end
...
...
ee/spec/models/security/orchestration_policy_configuration_spec.rb
View file @
0cd315eb
...
...
@@ -291,7 +291,7 @@ RSpec.describe Security::OrchestrationPolicyConfiguration do
end
describe
'#policy_last_updated_by'
do
let
(
:commit
)
{
create
(
:commit
,
author:
security_policy_management_project
.
owner
)
}
let
(
:commit
)
{
create
(
:commit
,
author:
security_policy_management_project
.
first_
owner
)
}
subject
(
:policy_last_updated_by
)
{
security_orchestration_policy_configuration
.
policy_last_updated_by
}
...
...
@@ -301,7 +301,7 @@ RSpec.describe Security::OrchestrationPolicyConfiguration do
end
context
'when last commit to policy file exists'
do
it
{
is_expected
.
to
eq
(
security_policy_management_project
.
owner
)
}
it
{
is_expected
.
to
eq
(
security_policy_management_project
.
first_
owner
)
}
end
context
'when last commit to policy file does not exist'
do
...
...
ee/spec/presenters/ee/blob_presenter_spec.rb
View file @
0cd315eb
...
...
@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec
.
describe
BlobPresenter
do
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:user
)
{
project
.
owner
}
let_it_be
(
:user
)
{
project
.
first_
owner
}
let
(
:blob
)
{
project
.
repository
.
blob_at
(
'HEAD'
,
'files/ruby/regex.rb'
)
}
...
...
ee/spec/requests/api/api_spec.rb
View file @
0cd315eb
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec
.
describe
API
::
API
do
describe
'logging'
,
:aggregate_failures
do
let_it_be
(
:project
)
{
create
(
:project
,
:public
)
}
let_it_be
(
:user
)
{
project
.
owner
}
let_it_be
(
:user
)
{
project
.
first_
owner
}
context
'when the method is not allowed'
do
it
'logs the route and context metadata for the client'
do
...
...
ee/spec/requests/api/ci/pipelines_spec.rb
View file @
0cd315eb
...
...
@@ -17,7 +17,7 @@ RSpec.describe API::Ci::Pipelines do
describe
'DELETE /projects/:id/pipelines/:pipeline_id'
do
context
'authorized user'
do
let
(
:owner
)
{
project
.
owner
}
let
(
:owner
)
{
project
.
first_
owner
}
context
'when audit events is enabled'
do
before
do
...
...
ee/spec/requests/api/graphql/mutations/projects/set_compliance_framework_spec.rb
View file @
0cd315eb
...
...
@@ -8,7 +8,7 @@ RSpec.describe 'Set project compliance framework' do
let_it_be
(
:namespace
)
{
create
(
:namespace
)
}
let_it_be
(
:project
)
{
create
(
:project
,
namespace:
namespace
)
}
let_it_be
(
:framework
)
{
create
(
:compliance_framework
,
namespace:
namespace
)
}
let_it_be
(
:current_user
)
{
project
.
owner
}
let_it_be
(
:current_user
)
{
project
.
first_
owner
}
let
(
:variables
)
{
{
project_id:
GitlabSchema
.
id_from_object
(
project
).
to_s
,
compliance_framework_id:
GitlabSchema
.
id_from_object
(
framework
).
to_s
}
}
...
...
ee/spec/requests/api/status_checks_spec.rb
View file @
0cd315eb
...
...
@@ -134,7 +134,7 @@ RSpec.describe API::StatusChecks do
it
'deletes the specified rule'
do
expect
do
delete
api
(
single_object_url
,
project
.
owner
)
delete
api
(
single_object_url
,
project
.
first_
owner
)
end
.
to
change
{
MergeRequests
::
ExternalStatusCheck
.
count
}.
by
(
-
1
)
end
...
...
@@ -152,7 +152,7 @@ RSpec.describe API::StatusChecks do
end
it
'returns the correct status code'
do
delete
api
(
single_object_url
,
(
project_owner
?
project
.
owner
:
build
(
:user
)))
delete
api
(
single_object_url
,
(
project_owner
?
project
.
first_
owner
:
build
(
:user
)))
expect
(
response
).
to
have_gitlab_http_status
(
status
)
end
...
...
@@ -167,7 +167,7 @@ RSpec.describe API::StatusChecks do
end
subject
do
post
api
(
"/projects/
#{
project
.
id
}
/external_status_checks"
,
project
.
owner
),
params:
attributes_for
(
:external_status_check
)
post
api
(
"/projects/
#{
project
.
id
}
/external_status_checks"
,
project
.
first_
owner
),
params:
attributes_for
(
:external_status_check
)
end
it
'creates a new external approval rule'
do
...
...
@@ -182,7 +182,7 @@ RSpec.describe API::StatusChecks do
end
subject
do
post
api
(
"/projects/
#{
project
.
id
}
/external_status_checks"
,
project
.
owner
),
params:
params
post
api
(
"/projects/
#{
project
.
id
}
/external_status_checks"
,
project
.
first_
owner
),
params:
params
end
it
'returns expected status code'
do
...
...
@@ -242,14 +242,14 @@ RSpec.describe API::StatusChecks do
end
it
'responds with expected JSON'
,
:aggregate_failures
do
get
api
(
collection_url
,
project
.
owner
)
get
api
(
collection_url
,
project
.
first_
owner
)
expect
(
json_response
.
size
).
to
eq
(
2
)
expect
(
json_response
.
map
{
|
r
|
r
[
'name'
]
}).
to
contain_exactly
(
'rule 1'
,
'rule 2'
)
end
it
'paginates correctly'
do
get
api
(
collection_url
,
project
.
owner
),
params:
{
per_page:
1
}
get
api
(
collection_url
,
project
.
first_
owner
),
params:
{
per_page:
1
}
expect_paginated_array_response
([
rule
.
id
])
end
...
...
@@ -268,7 +268,7 @@ RSpec.describe API::StatusChecks do
end
it
'returns the correct status code'
do
get
api
(
collection_url
,
(
project_owner
?
project
.
owner
:
build
(
:user
)))
get
api
(
collection_url
,
(
project_owner
?
project
.
first_
owner
:
build
(
:user
)))
expect
(
response
).
to
have_gitlab_http_status
(
status
)
end
...
...
@@ -285,7 +285,7 @@ RSpec.describe API::StatusChecks do
end
subject
do
put
api
(
single_object_url
,
project
.
owner
),
params:
params
put
api
(
single_object_url
,
project
.
first_
owner
),
params:
params
end
it
'updates an approval rule'
do
...
...
@@ -306,7 +306,7 @@ RSpec.describe API::StatusChecks do
end
subject
do
put
api
(
single_object_url
,
project
.
owner
),
params:
params
put
api
(
single_object_url
,
project
.
first_
owner
),
params:
params
end
it
'is invalid'
do
...
...
@@ -324,7 +324,7 @@ RSpec.describe API::StatusChecks do
end
subject
do
put
api
(
single_object_url
,
project
.
owner
),
params:
params
put
api
(
single_object_url
,
project
.
first_
owner
),
params:
params
end
it
'returns expected status code'
do
...
...
@@ -362,7 +362,7 @@ RSpec.describe API::StatusChecks do
end
it
'returns the correct status code'
do
put
api
(
single_object_url
,
(
project_owner
?
project
.
owner
:
build
(
:user
))),
params:
attributes_for
(
:external_status_check
)
put
api
(
single_object_url
,
(
project_owner
?
project
.
first_
owner
:
build
(
:user
))),
params:
attributes_for
(
:external_status_check
)
expect
(
response
).
to
have_gitlab_http_status
(
status
)
end
...
...
ee/spec/requests/projects/audit_events_spec.rb
View file @
0cd315eb
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec
.
describe
'view audit events'
do
describe
'GET /:namespace/:project/-/audit_events'
do
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:user
)
{
project
.
owner
}
let_it_be
(
:user
)
{
project
.
first_
owner
}
let_it_be
(
:audit_event
)
{
create
(
:project_audit_event
,
entity_id:
project
.
id
)
}
before
do
...
...
ee/spec/services/ci/create_pipeline_service/compliance_spec.rb
View file @
0cd315eb
...
...
@@ -8,7 +8,7 @@ RSpec.describe Ci::CreatePipelineService do
subject
(
:execute
)
{
service
.
execute
(
:push
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
name:
'website'
)
}
let
(
:user
)
{
project
.
owner
}
let
(
:user
)
{
project
.
first_
owner
}
let
(
:compliance_group
)
{
create
(
:group
,
:private
,
name:
"compliance"
)
}
let
(
:compliance_project
)
{
create
(
:project
,
:repository
,
namespace:
compliance_group
,
name:
"hippa"
)
}
let
(
:framework
)
{
create
(
:compliance_framework
,
namespace_id:
compliance_group
.
id
,
pipeline_configuration_full_path:
".compliance-gitlab-ci.yml@compliance/hippa"
)
}
...
...
@@ -37,7 +37,7 @@ RSpec.describe Ci::CreatePipelineService do
context
'when user has access to compliance project'
do
before
do
compliance_project
.
add_maintainer
(
project
.
owner
)
compliance_project
.
add_maintainer
(
project
.
first_
owner
)
end
it
'responds with success'
do
...
...
ee/spec/services/ci/create_pipeline_service/cross_needs_artifacts_spec.rb
View file @
0cd315eb
...
...
@@ -6,7 +6,7 @@ RSpec.describe Ci::CreatePipelineService do
subject
(
:execute
)
{
service
.
execute
(
:push
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:user
)
{
project
.
owner
}
let_it_be
(
:user
)
{
project
.
first_
owner
}
let
(
:service
)
do
described_class
.
new
(
project
,
user
,
{
ref:
'refs/heads/master'
})
...
...
ee/spec/services/ci/create_pipeline_service/needs_spec.rb
View file @
0cd315eb
...
...
@@ -6,7 +6,7 @@ RSpec.describe Ci::CreatePipelineService do
let_it_be
(
:downstream_project
)
{
create
(
:project
,
name:
'project'
,
namespace:
create
(
:namespace
,
name:
'some'
))
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:user
)
{
project
.
owner
}
let
(
:user
)
{
project
.
first_
owner
}
let
(
:service
)
{
described_class
.
new
(
project
,
user
,
{
ref:
'refs/heads/master'
})
}
let
(
:config
)
do
...
...
ee/spec/services/ci/create_pipeline_service/runnable_builds_spec.rb
View file @
0cd315eb
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec
.
describe
Ci
::
CreatePipelineService
,
:sidekiq_inline
do
let_it_be
(
:namespace
)
{
create
(
:namespace
,
:with_used_build_minutes_limit
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
,
namespace:
namespace
)
}
let_it_be
(
:user
)
{
project
.
owner
}
let_it_be
(
:user
)
{
project
.
first_
owner
}
let_it_be
(
:instance_runner
)
{
create
(
:ci_runner
,
:instance
,
:online
)
}
let
(
:service
)
do
...
...
ee/spec/services/ci/destroy_pipeline_service_spec.rb
View file @
0cd315eb
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec
.
describe
::
Ci
::
DestroyPipelineService
do
let
(
:project
)
{
create
(
:project
)
}
let!
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
)
}
let
(
:user
)
{
project
.
owner
}
let
(
:user
)
{
project
.
first_
owner
}
subject
{
described_class
.
new
(
project
,
user
).
execute
(
pipeline
)
}
...
...
ee/spec/services/ee/ci/pipeline_processing/atomic_processing_service_spec.rb
View file @
0cd315eb
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
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
)
...
...
ee/spec/services/ee/integrations/test/project_service_spec.rb
View file @
0cd315eb
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec
.
describe
::
Integrations
::
Test
::
ProjectService
do
describe
'#execute'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:user
)
{
project
.
owner
}
let
(
:user
)
{
project
.
first_
owner
}
let
(
:event
)
{
nil
}
let
(
:sample_data
)
{
{
data:
'sample'
}
}
let
(
:success_result
)
{
{
success:
true
,
result:
{}
}
}
...
...
ee/spec/services/ee/merge_requests/base_service_spec.rb
View file @
0cd315eb
...
...
@@ -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
)
}
let_it_be
(
:status_checks
)
{
create_list
(
:external_status_check
,
3
,
project:
project
)
}
...
...
@@ -38,7 +38,7 @@ RSpec.describe MergeRequests::BaseService do
it
'calls ParamsFilteringService'
do
expect
(
ApprovalRules
::
ParamsFilteringService
).
to
receive
(
:new
).
with
(
an_instance_of
(
MergeRequest
),
project
.
owner
,
project
.
first_
owner
,
params
).
and_return
(
params_filtering_service
)
expect
(
params_filtering_service
).
to
receive
(
:execute
).
and_return
(
params
)
...
...
ee/spec/services/ee/merge_requests/create_service_spec.rb
View file @
0cd315eb
...
...
@@ -56,7 +56,7 @@ RSpec.describe MergeRequests::CreateService do
describe
'#execute with blocking merge requests'
,
:clean_gitlab_redis_shared_state
do
let
(
:opts
)
{
{
title:
'Blocked MR'
,
source_branch:
'feature'
,
target_branch:
'master'
}
}
let
(
:user
)
{
project
.
owner
}
let
(
:user
)
{
project
.
first_
owner
}
it
'delegates to MergeRequests::UpdateBlocksService'
do
expect
(
MergeRequests
::
UpdateBlocksService
)
...
...
ee/spec/services/ee/notification_service_spec.rb
View file @
0cd315eb
...
...
@@ -115,7 +115,7 @@ RSpec.describe EE::NotificationService, :mailer do
let!
(
:project_member
)
{
create
(
:project_member
,
:invited
,
project:
project
)
}
it
'sends email'
do
expect
(
Notify
).
to
receive
(
:mirror_was_hard_failed_email
).
with
(
project
.
id
,
project
.
owner
.
id
).
and_call_original
expect
(
Notify
).
to
receive
(
:mirror_was_hard_failed_email
).
with
(
project
.
id
,
project
.
first_
owner
.
id
).
and_call_original
subject
.
mirror_was_hard_failed
(
project
)
end
...
...
@@ -134,7 +134,7 @@ RSpec.describe EE::NotificationService, :mailer do
let
(
:project
)
{
create
(
:project
,
:mirror
,
:import_hard_failed
)
}
it
'sends email'
do
expect
(
Notify
).
to
receive
(
:mirror_was_hard_failed_email
).
with
(
project
.
id
,
project
.
owner
.
id
).
and_call_original
expect
(
Notify
).
to
receive
(
:mirror_was_hard_failed_email
).
with
(
project
.
id
,
project
.
first_
owner
.
id
).
and_call_original
subject
.
mirror_was_hard_failed
(
project
)
end
...
...
@@ -181,7 +181,7 @@ RSpec.describe EE::NotificationService, :mailer do
project
=
create
(
:project
,
:mirror
,
:import_hard_failed
)
project
.
add_maintainer
(
user
)
expect
(
Notify
).
to
receive
(
:mirror_was_hard_failed_email
).
with
(
project
.
id
,
project
.
owner
.
id
).
and_call_original
expect
(
Notify
).
to
receive
(
:mirror_was_hard_failed_email
).
with
(
project
.
id
,
project
.
first_
owner
.
id
).
and_call_original
expect
(
Notify
).
to
receive
(
:mirror_was_hard_failed_email
).
with
(
project
.
id
,
user
.
id
).
and_call_original
subject
.
mirror_was_hard_failed
(
project
)
...
...
@@ -239,7 +239,7 @@ RSpec.describe EE::NotificationService, :mailer do
let!
(
:project_member
)
{
create
(
:project_member
,
:invited
,
project:
project
)
}
it
'sends email'
do
expect
(
Notify
).
to
receive
(
:mirror_was_disabled_email
).
with
(
project
.
id
,
project
.
owner
.
id
,
deleted_username
).
and_call_original
expect
(
Notify
).
to
receive
(
:mirror_was_disabled_email
).
with
(
project
.
id
,
project
.
first_
owner
.
id
,
deleted_username
).
and_call_original
subject
.
mirror_was_disabled
(
project
,
deleted_username
)
end
...
...
@@ -256,7 +256,7 @@ RSpec.describe EE::NotificationService, :mailer do
context
'when user is owner'
do
it
'sends email'
do
expect
(
Notify
).
to
receive
(
:mirror_was_disabled_email
).
with
(
project
.
id
,
project
.
owner
.
id
,
deleted_username
).
and_call_original
expect
(
Notify
).
to
receive
(
:mirror_was_disabled_email
).
with
(
project
.
id
,
project
.
first_
owner
.
id
,
deleted_username
).
and_call_original
subject
.
mirror_was_disabled
(
project
,
deleted_username
)
end
...
...
@@ -302,7 +302,7 @@ RSpec.describe EE::NotificationService, :mailer do
it
'sends email'
do
project
.
add_maintainer
(
user
)
expect
(
Notify
).
to
receive
(
:mirror_was_disabled_email
).
with
(
project
.
id
,
project
.
owner
.
id
,
deleted_username
).
and_call_original
expect
(
Notify
).
to
receive
(
:mirror_was_disabled_email
).
with
(
project
.
id
,
project
.
first_
owner
.
id
,
deleted_username
).
and_call_original
expect
(
Notify
).
to
receive
(
:mirror_was_disabled_email
).
with
(
project
.
id
,
user
.
id
,
deleted_username
).
and_call_original
subject
.
mirror_was_disabled
(
project
,
deleted_username
)
...
...
@@ -930,7 +930,7 @@ RSpec.describe EE::NotificationService, :mailer do
let_it_be
(
:participant
)
{
create
(
:incident_management_oncall_participant
,
rotation:
rotation
)
}
it
'sends an email to the owner and participants'
do
expect
(
Notify
).
to
receive
(
:user_removed_from_rotation_email
).
with
(
user
,
rotation
,
[
schedule
.
project
.
owner
]).
once
.
and_call_original
expect
(
Notify
).
to
receive
(
:user_removed_from_rotation_email
).
with
(
user
,
rotation
,
[
schedule
.
project
.
first_
owner
]).
once
.
and_call_original
expect
(
Notify
).
to
receive
(
:user_removed_from_rotation_email
).
with
(
user
,
rotation
,
[
participant
.
user
]).
once
.
and_call_original
subject
.
oncall_user_removed
(
rotation
,
user
)
...
...
@@ -949,14 +949,14 @@ RSpec.describe EE::NotificationService, :mailer do
let!
(
:rule_2
)
{
create
(
:incident_management_escalation_rule
,
:with_user
,
:resolved
,
project:
project
,
user:
user
)
}
it
'immediately sends an email to the project owner'
do
expect
(
Notify
).
to
receive
(
:user_escalation_rule_deleted_email
).
with
(
user
,
project
,
rules
,
project
.
owner
).
once
.
and_call_original
expect
(
Notify
).
to
receive
(
:user_escalation_rule_deleted_email
).
with
(
user
,
project
,
rules
,
project
.
first_
owner
).
once
.
and_call_original
expect
(
Notify
).
not_to
receive
(
:user_escalation_rule_deleted_email
).
with
(
user
,
project
,
rules
,
user
)
expect
{
subject
.
user_escalation_rule_deleted
(
project
,
user
,
rules
)
}.
to
change
(
ActionMailer
::
Base
.
deliveries
,
:size
).
by
(
1
)
end
context
'when project owner is the removed user'
do
let
(
:user
)
{
project
.
owner
}
let
(
:user
)
{
project
.
first_
owner
}
it
'does not send an email'
do
expect
(
Notify
).
not_to
receive
(
:user_escalation_rule_deleted_email
)
...
...
ee/spec/services/ee/protected_branches/create_service_spec.rb
View file @
0cd315eb
...
...
@@ -8,7 +8,7 @@ RSpec.describe ProtectedBranches::CreateService do
let
(
:source_project
)
{
create
(
:project
)
}
let
(
:target_project
)
{
fork_project
(
source_project
,
user
,
repository:
true
)
}
let
(
:user
)
{
source_project
.
owner
}
let
(
:user
)
{
source_project
.
first_
owner
}
let
(
:params
)
do
{
...
...
ee/spec/services/ee/protected_branches/destroy_service_spec.rb
View file @
0cd315eb
...
...
@@ -6,7 +6,7 @@ RSpec.describe ProtectedBranches::DestroyService do
let
(
:protected_branch
)
{
create
(
:protected_branch
)
}
let
(
:branch_name
)
{
protected_branch
.
name
}
let
(
:project
)
{
protected_branch
.
project
}
let
(
:user
)
{
project
.
owner
}
let
(
:user
)
{
project
.
first_
owner
}
describe
'#execute'
do
subject
(
:service
)
{
described_class
.
new
(
project
,
user
)
}
...
...
ee/spec/services/ee/protected_branches/update_service_spec.rb
View file @
0cd315eb
...
...
@@ -6,7 +6,7 @@ RSpec.describe ProtectedBranches::UpdateService do
let
(
:branch_name
)
{
'feature'
}
let
(
:protected_branch
)
{
create
(
:protected_branch
,
name:
branch_name
)
}
let
(
:project
)
{
protected_branch
.
project
}
let
(
:user
)
{
project
.
owner
}
let
(
:user
)
{
project
.
first_
owner
}
subject
(
:service
)
{
described_class
.
new
(
project
,
user
,
params
)
}
...
...
ee/spec/services/ee/users/destroy_service_spec.rb
View file @
0cd315eb
...
...
@@ -83,7 +83,7 @@ RSpec.describe Users::DestroyService do
context
'when user has escalation rules'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:user
)
{
project
.
owner
}
let
(
:user
)
{
project
.
first_
owner
}
let
(
:project_policy
)
{
create
(
:incident_management_escalation_policy
,
project:
project
)
}
let!
(
:project_rule
)
{
create
(
:incident_management_escalation_rule
,
:with_user
,
policy:
project_policy
,
user:
user
)
}
...
...
ee/spec/services/external_status_checks/create_service_spec.rb
View file @
0cd315eb
...
...
@@ -6,7 +6,7 @@ RSpec.describe ExternalStatusChecks::CreateService do
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:protected_branch
)
{
create
(
:protected_branch
,
project:
project
)
}
let
(
:user
)
{
project
.
owner
}
let
(
:user
)
{
project
.
first_
owner
}
let
(
:params
)
do
{
name:
'Test'
,
...
...
ee/spec/services/external_status_checks/destroy_service_spec.rb
View file @
0cd315eb
...
...
@@ -6,7 +6,7 @@ RSpec.describe ExternalStatusChecks::DestroyService do
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:rule
)
{
create
(
:external_status_check
,
project:
project
)
}
let
(
:current_user
)
{
project
.
owner
}
let
(
:current_user
)
{
project
.
first_
owner
}
subject
{
described_class
.
new
(
container:
project
,
current_user:
current_user
).
execute
(
rule
)
}
...
...
ee/spec/services/external_status_checks/update_service_spec.rb
View file @
0cd315eb
...
...
@@ -7,7 +7,7 @@ RSpec.describe ExternalStatusChecks::UpdateService do
let_it_be
(
:check
)
{
create
(
:external_status_check
,
project:
project
)
}
let_it_be
(
:protected_branch
)
{
create
(
:protected_branch
,
project:
project
)
}
let
(
:current_user
)
{
project
.
owner
}
let
(
:current_user
)
{
project
.
first_
owner
}
let
(
:params
)
{
{
id:
project
.
id
,
check_id:
check
.
id
,
external_url:
'http://newvalue.com'
,
name:
'new name'
,
protected_branch_ids:
[
protected_branch
.
id
]
}
}
subject
{
described_class
.
new
(
container:
project
,
current_user:
current_user
,
params:
params
).
execute
}
...
...
ee/spec/services/merge_requests/update_blocks_service_spec.rb
View file @
0cd315eb
...
...
@@ -26,7 +26,7 @@ RSpec.describe MergeRequests::UpdateBlocksService do
describe
'#execute'
do
let
(
:merge_request
)
{
create
(
:merge_request
)
}
let
(
:user
)
{
merge_request
.
target_project
.
owner
}
let
(
:user
)
{
merge_request
.
target_project
.
first_
owner
}
let
(
:mr_to_ignore
)
{
create
(
:merge_request
)
}
let
(
:mr_to_add
)
{
create
(
:merge_request
)
}
...
...
ee/spec/services/projects/destroy_service_spec.rb
View file @
0cd315eb
...
...
@@ -24,7 +24,7 @@ RSpec.describe Projects::DestroyService do
let
(
:max_capacity
)
{
Gitlab
::
CurrentSettings
.
mirror_max_capacity
}
let_it_be
(
:project_mirror
)
{
create
(
:project
,
:mirror
,
:repository
,
:import_scheduled
)
}
let
(
:result
)
{
described_class
.
new
(
project_mirror
,
project_mirror
.
owner
,
{}).
execute
}
let
(
:result
)
{
described_class
.
new
(
project_mirror
,
project_mirror
.
first_
owner
,
{}).
execute
}
before
do
Gitlab
::
Mirror
.
increment_capacity
(
project_mirror
.
id
)
...
...
ee/spec/services/projects/update_mirror_service_spec.rb
View file @
0cd315eb
...
...
@@ -7,7 +7,7 @@ RSpec.describe Projects::UpdateMirrorService do
create
(
:project
,
:repository
,
:mirror
,
import_url:
Project
::
UNKNOWN_IMPORT_URL
,
only_mirror_protected_branches:
false
)
end
subject
(
:service
)
{
described_class
.
new
(
project
,
project
.
owner
)
}
subject
(
:service
)
{
described_class
.
new
(
project
,
project
.
first_
owner
)
}
describe
"#execute"
do
context
'unlicensed'
do
...
...
@@ -121,7 +121,7 @@ RSpec.describe Projects::UpdateMirrorService do
stub_fetch_mirror
(
project
)
expect
(
Git
::
TagPushService
).
to
receive
(
:new
)
.
with
(
project
,
project
.
owner
,
change:
hash_including
(
ref:
'refs/tags/new-tag'
),
mirror_update:
true
)
.
with
(
project
,
project
.
first_
owner
,
change:
hash_including
(
ref:
'refs/tags/new-tag'
),
mirror_update:
true
)
.
and_return
(
double
(
execute:
true
))
service
.
execute
...
...
@@ -326,7 +326,7 @@ RSpec.describe Projects::UpdateMirrorService do
def
create_file
(
repository
)
repository
.
create_file
(
project
.
owner
,
project
.
first_
owner
,
'/newfile.txt'
,
'hello'
,
message:
'Add newfile.txt'
,
...
...
ee/spec/services/search/project_service_spec.rb
View file @
0cd315eb
...
...
@@ -15,7 +15,7 @@ RSpec.describe Search::ProjectService do
it_behaves_like
'EE search service shared examples'
,
::
Gitlab
::
ProjectSearchResults
,
::
Gitlab
::
Elastic
::
ProjectSearchResults
do
let_it_be
(
:scope
)
{
create
(
:project
)
}
let
(
:user
)
{
scope
.
owner
}
let
(
:user
)
{
scope
.
first_
owner
}
let
(
:service
)
{
described_class
.
new
(
scope
,
user
,
params
)
}
end
end
...
...
ee/spec/services/security/security_orchestration_policies/create_pipeline_service_spec.rb
View file @
0cd315eb
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec
.
describe
Security
::
SecurityOrchestrationPolicies
::
CreatePipelineService
do
describe
'#execute'
do
let_it_be_with_reload
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:current_user
)
{
project
.
owner
}
let_it_be
(
:current_user
)
{
project
.
first_
owner
}
let_it_be
(
:branch
)
{
project
.
default_branch
}
let
(
:action
)
{
{
scan:
'secret_detection'
}
}
...
...
ee/spec/services/security/security_orchestration_policies/policy_commit_service_spec.rb
View file @
0cd315eb
...
...
@@ -7,7 +7,7 @@ RSpec.describe Security::SecurityOrchestrationPolicies::PolicyCommitService do
describe
'#execute'
do
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:current_user
)
{
project
.
owner
}
let_it_be
(
:current_user
)
{
project
.
first_
owner
}
let_it_be
(
:policy_management_project
)
{
create
(
:project
,
:repository
,
creator:
current_user
)
}
let_it_be
(
:policy_configuration
)
{
create
(
:security_orchestration_policy_configuration
,
security_policy_management_project:
policy_management_project
,
project:
project
)
}
...
...
ee/spec/services/security/security_orchestration_policies/process_scan_result_policy_service_spec.rb
View file @
0cd315eb
...
...
@@ -10,12 +10,12 @@ RSpec.describe Security::SecurityOrchestrationPolicies::ProcessScanResultPolicyS
let
(
:policy
)
{
build
(
:scan_result_policy
,
name:
'Test Policy'
)
}
let
(
:policy_yaml
)
{
Gitlab
::
Config
::
Loader
::
Yaml
.
new
(
policy
.
to_yaml
).
load!
}
let
(
:project
)
{
policy_configuration
.
project
}
let
(
:approver
)
{
project
.
owner
}
let
(
:approver
)
{
project
.
first_
owner
}
let
(
:service
)
{
described_class
.
new
(
policy_configuration:
policy_configuration
,
policy:
policy
,
policy_index:
0
)
}
before
do
group
.
add_maintainer
(
approver
)
allow
(
policy_configuration
).
to
receive
(
:policy_last_updated_by
).
and_return
(
project
.
owner
)
allow
(
policy_configuration
).
to
receive
(
:policy_last_updated_by
).
and_return
(
project
.
first_
owner
)
end
subject
{
service
.
execute
}
...
...
ee/spec/services/security/security_orchestration_policies/project_create_service_spec.rb
View file @
0cd315eb
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec
.
describe
Security
::
SecurityOrchestrationPolicies
::
ProjectCreateService
do
describe
'#execute'
do
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:current_user
)
{
project
.
owner
}
let_it_be
(
:current_user
)
{
project
.
first_
owner
}
subject
(
:service
)
{
described_class
.
new
(
project:
project
,
current_user:
current_user
)
}
...
...
@@ -33,7 +33,7 @@ RSpec.describe Security::SecurityOrchestrationPolicies::ProjectCreateService do
context
'when adding users to security policy project fails'
do
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:current_user
)
{
project
.
owner
}
let_it_be
(
:current_user
)
{
project
.
first_
owner
}
let_it_be
(
:maintainer
)
{
create
(
:user
)
}
before
do
...
...
ee/spec/services/security/store_report_service_spec.rb
View file @
0cd315eb
...
...
@@ -766,7 +766,7 @@ RSpec.describe Security::StoreReportService, '#execute', :snowplow do
before
do
stub_licensed_features
(
container_scanning:
true
,
security_dashboard:
true
)
allow
(
pipeline
).
to
receive
(
:user
).
and_return
(
project
.
owner
)
allow
(
pipeline
).
to
receive
(
:user
).
and_return
(
project
.
first_
owner
)
end
it
'populates finding location'
do
...
...
ee/spec/support/shared_contexts/graphql/resolvers/security_orchestration/resolves_orchestration_policy_shared_contexts.rb
View file @
0cd315eb
...
...
@@ -4,5 +4,5 @@ RSpec.shared_context 'orchestration policy context' do
let_it_be
(
:policy_last_updated_at
)
{
Time
.
now
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:policy_management_project
)
{
create
(
:project
)
}
let_it_be
(
:user
)
{
policy_management_project
.
owner
}
let_it_be
(
:user
)
{
policy_management_project
.
first_
owner
}
end
ee/spec/support/shared_examples/quick_actions/issue/status_page_quick_actions_shared_examples.rb
View file @
0cd315eb
...
...
@@ -4,7 +4,7 @@ RSpec.shared_examples 'status page quick actions' do
describe
'/publish'
do
let_it_be
(
:status_page_setting
)
{
create
(
:status_page_setting
,
:enabled
,
project:
project
)
}
let
(
:user
)
{
project
.
owner
}
let
(
:user
)
{
project
.
first_
owner
}
before
do
stub_licensed_features
(
status_page:
true
)
...
...
ee/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
View file @
0cd315eb
...
...
@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec
.
describe
'layouts/nav/sidebar/_project'
do
let_it_be_with_refind
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:user
)
{
project
.
owner
}
let_it_be
(
:user
)
{
project
.
first_
owner
}
before
do
assign
(
:project
,
project
)
...
...
@@ -63,7 +63,7 @@ RSpec.describe 'layouts/nav/sidebar/_project' do
describe
'Jira'
do
let_it_be_with_refind
(
:project
)
{
create
(
:project
,
has_external_issue_tracker:
true
)
}
let
(
:user
)
{
project
.
owner
}
let
(
:user
)
{
project
.
first_
owner
}
before
do
allow
(
view
).
to
receive
(
:current_user
).
and_return
(
user
)
...
...
@@ -100,7 +100,7 @@ RSpec.describe 'layouts/nav/sidebar/_project' do
end
describe
'Requirements'
do
let
(
:user
)
{
project
.
owner
}
let
(
:user
)
{
project
.
first_
owner
}
before
do
stub_licensed_features
(
requirements:
true
)
...
...
ee/spec/views/projects/security/policies/index.html.haml_spec.rb
View file @
0cd315eb
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
RSpec
.
describe
"projects/security/policies/index"
,
type: :view
do
let
(
:user
)
{
project
.
owner
}
let
(
:user
)
{
project
.
first_
owner
}
let
(
:project
)
{
create
(
:project
)
}
before
do
...
...
ee/spec/views/shared/_mirror_status.html.haml_spec.rb
View file @
0cd315eb
...
...
@@ -10,7 +10,7 @@ RSpec.describe 'shared/_mirror_status.html.haml' do
before
do
@project
=
project
# for the view
sign_in
(
project
.
owner
)
sign_in
(
project
.
first_
owner
)
end
context
'when mirror has not updated yet'
do
...
...
ee/spec/views/shared/_mirror_update_button.html.haml_spec.rb
View file @
0cd315eb
...
...
@@ -9,7 +9,7 @@ RSpec.describe 'shared/mirror_update_button' do
let
(
:import_state
)
{
project
.
import_state
}
let
(
:owner
)
{
project
.
owner
}
let
(
:owner
)
{
project
.
first_
owner
}
let
(
:developer
)
{
create
(
:user
).
tap
{
|
user
|
project
.
team
.
add_developer
(
user
)
}
}
let
(
:reporter
)
{
create
(
:user
).
tap
{
|
user
|
project
.
team
.
add_reporter
(
user
)
}
}
...
...
ee/spec/workers/post_receive_spec.rb
View file @
0cd315eb
...
...
@@ -11,7 +11,7 @@ RSpec.describe PostReceive do
let
(
:base64_changes
)
{
Base64
.
encode64
(
wrongly_encoded_changes
)
}
let
(
:base64_changes_with_master
)
{
Base64
.
encode64
(
changes_with_master
)
}
let
(
:gl_repository
)
{
"project-
#{
project
.
id
}
"
}
let
(
:key
)
{
create
(
:key
,
user:
project
.
owner
)
}
let
(
:key
)
{
create
(
:key
,
user:
project
.
first_
owner
)
}
let
(
:key_id
)
{
key
.
shell_id
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
...
...
@@ -55,7 +55,7 @@ RSpec.describe PostReceive do
]
expect
(
::
RepositoryPushAuditEventWorker
).
to
receive
(
:perform_async
)
.
with
(
expected_changes
,
project
.
id
,
project
.
owner
.
id
)
.
with
(
expected_changes
,
project
.
id
,
project
.
first_
owner
.
id
)
described_class
.
new
.
perform
(
gl_repository
,
key_id
,
base64_changes
)
end
...
...
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