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
0e4bf1a3
Commit
0e4bf1a3
authored
Feb 04, 2020
by
Vitali Tatarintev
Committed by
Shinya Maeda
Feb 04, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change set to let_it_be in ee/spec/requests
Contributes to a removal of rspec-set gem
parent
ecd631f1
Changes
65
Hide whitespace changes
Inline
Side-by-side
Showing
65 changed files
with
198 additions
and
201 deletions
+198
-201
ee/spec/requests/api/audit_events_spec.rb
ee/spec/requests/api/audit_events_spec.rb
+4
-4
ee/spec/requests/api/boards_spec.rb
ee/spec/requests/api/boards_spec.rb
+4
-4
ee/spec/requests/api/dependencies_spec.rb
ee/spec/requests/api/dependencies_spec.rb
+2
-2
ee/spec/requests/api/geo_spec.rb
ee/spec/requests/api/geo_spec.rb
+4
-4
ee/spec/requests/api/graphql/current_user/todos_query_spec.rb
...pec/requests/api/graphql/current_user/todos_query_spec.rb
+3
-3
ee/spec/requests/api/graphql/mutations/notes/create/note_spec.rb
.../requests/api/graphql/mutations/notes/create/note_spec.rb
+1
-1
ee/spec/requests/api/graphql/project/issue/designs/designs_spec.rb
...equests/api/graphql/project/issue/designs/designs_spec.rb
+7
-7
ee/spec/requests/api/graphql/project/issue/designs/notes_spec.rb
.../requests/api/graphql/project/issue/designs/notes_spec.rb
+5
-5
ee/spec/requests/api/group_boards_spec.rb
ee/spec/requests/api/group_boards_spec.rb
+14
-14
ee/spec/requests/api/groups_spec.rb
ee/spec/requests/api/groups_spec.rb
+5
-5
ee/spec/requests/api/internal/base_spec.rb
ee/spec/requests/api/internal/base_spec.rb
+8
-8
ee/spec/requests/api/issues_spec.rb
ee/spec/requests/api/issues_spec.rb
+9
-9
ee/spec/requests/api/jobs_spec.rb
ee/spec/requests/api/jobs_spec.rb
+2
-2
ee/spec/requests/api/ldap_spec.rb
ee/spec/requests/api/ldap_spec.rb
+2
-2
ee/spec/requests/api/managed_licenses_spec.rb
ee/spec/requests/api/managed_licenses_spec.rb
+5
-5
ee/spec/requests/api/merge_request_approval_rules_spec.rb
ee/spec/requests/api/merge_request_approval_rules_spec.rb
+3
-3
ee/spec/requests/api/merge_request_approvals_spec.rb
ee/spec/requests/api/merge_request_approvals_spec.rb
+9
-10
ee/spec/requests/api/namespaces_spec.rb
ee/spec/requests/api/namespaces_spec.rb
+9
-8
ee/spec/requests/api/project_approval_rules_spec.rb
ee/spec/requests/api/project_approval_rules_spec.rb
+7
-7
ee/spec/requests/api/project_approval_settings_spec.rb
ee/spec/requests/api/project_approval_settings_spec.rb
+7
-7
ee/spec/requests/api/project_approvals_spec.rb
ee/spec/requests/api/project_approvals_spec.rb
+6
-6
ee/spec/requests/api/resource_label_events_spec.rb
ee/spec/requests/api/resource_label_events_spec.rb
+1
-1
ee/spec/requests/api/runner_spec.rb
ee/spec/requests/api/runner_spec.rb
+1
-1
ee/spec/requests/api/search_spec.rb
ee/spec/requests/api/search_spec.rb
+2
-2
ee/spec/requests/api/services_spec.rb
ee/spec/requests/api/services_spec.rb
+2
-2
ee/spec/requests/api/templates_spec.rb
ee/spec/requests/api/templates_spec.rb
+1
-1
ee/spec/requests/api/todos_spec.rb
ee/spec/requests/api/todos_spec.rb
+2
-3
ee/spec/requests/api/unleash_spec.rb
ee/spec/requests/api/unleash_spec.rb
+1
-1
ee/spec/requests/git_http_geo_spec.rb
ee/spec/requests/git_http_geo_spec.rb
+4
-4
ee/spec/requests/repositories/git_http_controller_spec.rb
ee/spec/requests/repositories/git_http_controller_spec.rb
+2
-2
ee/spec/serializers/clusters/environment_entity_spec.rb
ee/spec/serializers/clusters/environment_entity_spec.rb
+4
-4
ee/spec/serializers/clusters/environment_serializer_spec.rb
ee/spec/serializers/clusters/environment_serializer_spec.rb
+3
-4
ee/spec/serializers/dependency_entity_spec.rb
ee/spec/serializers/dependency_entity_spec.rb
+1
-1
ee/spec/serializers/dependency_list_serializer_spec.rb
ee/spec/serializers/dependency_list_serializer_spec.rb
+2
-2
ee/spec/serializers/merge_request_poll_widget_entity_spec.rb
ee/spec/serializers/merge_request_poll_widget_entity_spec.rb
+3
-3
ee/spec/serializers/merge_request_widget_entity_spec.rb
ee/spec/serializers/merge_request_widget_entity_spec.rb
+5
-5
ee/spec/serializers/pipeline_serializer_spec.rb
ee/spec/serializers/pipeline_serializer_spec.rb
+2
-2
ee/spec/serializers/vulnerabilities/feedback_entity_spec.rb
ee/spec/serializers/vulnerabilities/feedback_entity_spec.rb
+2
-2
ee/spec/serializers/vulnerabilities/occurrence_entity_spec.rb
...pec/serializers/vulnerabilities/occurrence_entity_spec.rb
+2
-2
ee/spec/serializers/vulnerabilities/occurrence_reports_comparer_entity_spec.rb
...ulnerabilities/occurrence_reports_comparer_entity_spec.rb
+1
-1
ee/spec/support/shared_examples/features/insights_shared_examples.rb
...port/shared_examples/features/insights_shared_examples.rb
+1
-1
ee/spec/support/shared_examples/models/concerns/elastic/limited_indexing_shared_examples.rb
...dels/concerns/elastic/limited_indexing_shared_examples.rb
+1
-1
ee/spec/support/shared_examples/serializers/report_status_shared_examples.rb
...red_examples/serializers/report_status_shared_examples.rb
+2
-2
ee/spec/tasks/geo/git_rake_spec.rb
ee/spec/tasks/geo/git_rake_spec.rb
+2
-2
ee/spec/views/admin/application_settings/_elasticsearch_form.html.haml_spec.rb
...pplication_settings/_elasticsearch_form.html.haml_spec.rb
+1
-1
ee/spec/views/admin/groups/_form.html.haml_spec.rb
ee/spec/views/admin/groups/_form.html.haml_spec.rb
+1
-1
ee/spec/views/clusters/clusters/show.html.haml_spec.rb
ee/spec/views/clusters/clusters/show.html.haml_spec.rb
+1
-1
ee/spec/views/groups/edit.html.haml_spec.rb
ee/spec/views/groups/edit.html.haml_spec.rb
+1
-1
ee/spec/views/projects/pipelines/_tabs_content.html.haml_spec.rb
.../views/projects/pipelines/_tabs_content.html.haml_spec.rb
+1
-1
ee/spec/views/shared/_clone_panel.html.haml_spec.rb
ee/spec/views/shared/_clone_panel.html.haml_spec.rb
+3
-3
ee/spec/workers/ci/create_cross_project_pipeline_worker_spec.rb
...c/workers/ci/create_cross_project_pipeline_worker_spec.rb
+3
-3
ee/spec/workers/design_management/new_version_worker_spec.rb
ee/spec/workers/design_management/new_version_worker_spec.rb
+2
-2
ee/spec/workers/ee/repository_check/batch_worker_spec.rb
ee/spec/workers/ee/repository_check/batch_worker_spec.rb
+2
-2
ee/spec/workers/ee/repository_check/single_repository_worker_spec.rb
...kers/ee/repository_check/single_repository_worker_spec.rb
+4
-4
ee/spec/workers/elastic_namespace_indexer_worker_spec.rb
ee/spec/workers/elastic_namespace_indexer_worker_spec.rb
+1
-1
ee/spec/workers/geo/batch/project_registry_scheduler_worker_spec.rb
...rkers/geo/batch/project_registry_scheduler_worker_spec.rb
+1
-1
ee/spec/workers/geo/batch/project_registry_worker_spec.rb
ee/spec/workers/geo/batch/project_registry_worker_spec.rb
+1
-1
ee/spec/workers/geo/prune_event_log_worker_spec.rb
ee/spec/workers/geo/prune_event_log_worker_spec.rb
+3
-3
ee/spec/workers/geo/repository_cleanup_worker_spec.rb
ee/spec/workers/geo/repository_cleanup_worker_spec.rb
+3
-3
ee/spec/workers/geo/repository_verification/primary/batch_worker_spec.rb
.../geo/repository_verification/primary/batch_worker_spec.rb
+1
-1
ee/spec/workers/geo/repository_verification/primary/single_worker_spec.rb
...geo/repository_verification/primary/single_worker_spec.rb
+1
-2
ee/spec/workers/geo/repository_verification/secondary/scheduler_worker_spec.rb
...epository_verification/secondary/scheduler_worker_spec.rb
+1
-1
ee/spec/workers/incident_management/process_alert_worker_spec.rb
.../workers/incident_management/process_alert_worker_spec.rb
+1
-1
ee/spec/workers/jira_connect/sync_branch_worker_spec.rb
ee/spec/workers/jira_connect/sync_branch_worker_spec.rb
+1
-1
ee/spec/workers/remove_unreferenced_lfs_objects_worker_spec.rb
...ec/workers/remove_unreferenced_lfs_objects_worker_spec.rb
+2
-2
No files found.
ee/spec/requests/api/audit_events_spec.rb
View file @
0e4bf1a3
...
...
@@ -24,9 +24,9 @@ describe API::AuditEvents do
end
context
'audit events feature is available'
do
set
(
:user_audit_event
)
{
create
(
:user_audit_event
,
created_at:
Date
.
new
(
2000
,
1
,
10
))
}
set
(
:project_audit_event
)
{
create
(
:project_audit_event
,
created_at:
Date
.
new
(
2000
,
1
,
15
))
}
set
(
:group_audit_event
)
{
create
(
:group_audit_event
,
created_at:
Date
.
new
(
2000
,
1
,
20
))
}
let_it_be
(
:user_audit_event
)
{
create
(
:user_audit_event
,
created_at:
Date
.
new
(
2000
,
1
,
10
))
}
let_it_be
(
:project_audit_event
)
{
create
(
:project_audit_event
,
created_at:
Date
.
new
(
2000
,
1
,
15
))
}
let_it_be
(
:group_audit_event
)
{
create
(
:group_audit_event
,
created_at:
Date
.
new
(
2000
,
1
,
20
))
}
before
do
stub_licensed_features
(
admin_audit_log:
true
)
...
...
@@ -118,7 +118,7 @@ describe API::AuditEvents do
end
describe
'GET /audit_events/:id'
do
set
(
:user_audit_event
)
{
create
(
:user_audit_event
,
created_at:
Date
.
new
(
2000
,
1
,
10
))
}
let_it_be
(
:user_audit_event
)
{
create
(
:user_audit_event
,
created_at:
Date
.
new
(
2000
,
1
,
10
))
}
let
(
:url
)
{
"/audit_events/
#{
user_audit_event
.
id
}
"
}
context
'when authenticated, as a user'
do
...
...
ee/spec/requests/api/boards_spec.rb
View file @
0e4bf1a3
...
...
@@ -3,10 +3,10 @@
require
'spec_helper'
describe
API
::
Boards
do
set
(
:user
)
{
create
(
:user
)
}
set
(
:board_parent
)
{
create
(
:project
,
:public
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
}
set
(
:milestone
)
{
create
(
:milestone
,
project:
board_parent
)
}
set
(
:board
)
{
create
(
:board
,
project:
board_parent
,
milestone:
milestone
,
assignee:
user
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:board_parent
)
{
create
(
:project
,
:public
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
}
let_it_be
(
:milestone
)
{
create
(
:milestone
,
project:
board_parent
)
}
let_it_be
(
:board
)
{
create
(
:board
,
project:
board_parent
,
milestone:
milestone
,
assignee:
user
)
}
it_behaves_like
'multiple and scoped issue boards'
,
"/projects/:id/boards"
...
...
ee/spec/requests/api/dependencies_spec.rb
View file @
0e4bf1a3
...
...
@@ -3,8 +3,8 @@
require
'spec_helper'
describe
API
::
Dependencies
do
set
(
:project
)
{
create
(
:project
,
:public
)
}
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:public
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
describe
"GET /projects/:id/dependencies"
do
subject
(
:request
)
{
get
api
(
"/projects/
#{
project
.
id
}
/dependencies"
,
user
),
params:
params
}
...
...
ee/spec/requests/api/geo_spec.rb
View file @
0e4bf1a3
...
...
@@ -7,10 +7,10 @@ describe API::Geo do
include
ApiHelpers
include
::
EE
::
GeoHelpers
set
(
:admin
)
{
create
(
:admin
)
}
set
(
:user
)
{
create
(
:user
)
}
set
(
:primary_node
)
{
create
(
:geo_node
,
:primary
)
}
set
(
:secondary_node
)
{
create
(
:geo_node
)
}
let_it_be
(
:admin
)
{
create
(
:admin
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:primary_node
)
{
create
(
:geo_node
,
:primary
)
}
let_it_be
(
:secondary_node
)
{
create
(
:geo_node
)
}
let
(
:geo_token_header
)
do
{
'X-Gitlab-Token'
=>
secondary_node
.
system_hook
.
token
}
end
...
...
ee/spec/requests/api/graphql/current_user/todos_query_spec.rb
View file @
0e4bf1a3
...
...
@@ -5,9 +5,9 @@ require 'spec_helper'
describe
'getting project information'
do
include
GraphqlHelpers
set
(
:current_user
)
{
create
(
:user
)
}
set
(
:design_todo
)
{
create
(
:todo
,
user:
current_user
,
target:
create
(
:design
))
}
set
(
:epic_todo
)
{
create
(
:todo
,
user:
current_user
,
target:
create
(
:epic
))
}
let_it_be
(
:current_user
)
{
create
(
:user
)
}
let_it_be
(
:design_todo
)
{
create
(
:todo
,
user:
current_user
,
target:
create
(
:design
))
}
let_it_be
(
:epic_todo
)
{
create
(
:todo
,
user:
current_user
,
target:
create
(
:epic
))
}
let
(
:fields
)
do
<<~
QUERY
nodes {
...
...
ee/spec/requests/api/graphql/mutations/notes/create/note_spec.rb
View file @
0e4bf1a3
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
describe
'Adding a Note to an Epic'
do
include
GraphqlHelpers
set
(
:current_user
)
{
create
(
:user
)
}
let_it_be
(
:current_user
)
{
create
(
:user
)
}
let
(
:epic
)
{
create
(
:epic
,
group:
group
)
}
let
(
:mutation
)
do
variables
=
{
...
...
ee/spec/requests/api/graphql/project/issue/designs/designs_spec.rb
View file @
0e4bf1a3
...
...
@@ -6,8 +6,8 @@ describe 'Getting designs related to an issue' do
include
GraphqlHelpers
include
DesignManagementTestHelpers
set
(
:design
)
{
create
(
:design
,
:with_file
,
versions_count:
1
)
}
set
(
:current_user
)
{
design
.
project
.
owner
}
let_it_be
(
:design
)
{
create
(
:design
,
:with_file
,
versions_count:
1
)
}
let_it_be
(
:current_user
)
{
design
.
project
.
owner
}
let
(
:design_query
)
do
<<~
NODE
designs {
...
...
@@ -112,7 +112,7 @@ describe 'Getting designs related to an issue' do
end
context
'with versions'
do
set
(
:version
)
{
design
.
versions
.
take
}
let_it_be
(
:version
)
{
design
.
versions
.
take
}
let
(
:design_query
)
do
<<~
NODE
designs {
...
...
@@ -151,9 +151,9 @@ describe 'Getting designs related to an issue' do
end
describe
'viewing a design board at a particular version'
do
set
(
:issue
)
{
design
.
issue
}
set
(
:second_design
)
{
create
(
:design
,
:with_file
,
issue:
issue
,
versions_count:
1
)
}
set
(
:deleted_design
)
{
create
(
:design
,
:with_versions
,
issue:
issue
,
deleted:
true
,
versions_count:
1
)
}
let_it_be
(
:issue
)
{
design
.
issue
}
let_it_be
(
:second_design
)
{
create
(
:design
,
:with_file
,
issue:
issue
,
versions_count:
1
)
}
let_it_be
(
:deleted_design
)
{
create
(
:design
,
:with_versions
,
issue:
issue
,
deleted:
true
,
versions_count:
1
)
}
let
(
:all_versions
)
{
issue
.
design_versions
.
ordered
.
reverse
}
let
(
:design_query
)
do
<<~
NODE
...
...
@@ -318,7 +318,7 @@ describe 'Getting designs related to an issue' do
end
describe
'a design with note annotations'
do
set
(
:note
)
{
create
(
:diff_note_on_design
,
noteable:
design
,
project:
design
.
project
)
}
let_it_be
(
:note
)
{
create
(
:diff_note_on_design
,
noteable:
design
,
project:
design
.
project
)
}
let
(
:design_query
)
do
<<~
NODE
...
...
ee/spec/requests/api/graphql/project/issue/designs/notes_spec.rb
View file @
0e4bf1a3
...
...
@@ -6,11 +6,11 @@ describe 'Getting designs related to an issue' do
include
GraphqlHelpers
include
DesignManagementTestHelpers
set
(
:project
)
{
create
(
:project
,
:public
)
}
set
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
set
(
:design
)
{
create
(
:design
,
:with_file
,
versions_count:
1
,
issue:
issue
)
}
set
(
:current_user
)
{
project
.
owner
}
set
(
:note
)
{
create
(
:diff_note_on_design
,
noteable:
design
,
project:
project
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:public
)
}
let_it_be
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let_it_be
(
:design
)
{
create
(
:design
,
:with_file
,
versions_count:
1
,
issue:
issue
)
}
let_it_be
(
:current_user
)
{
project
.
owner
}
let_it_be
(
:note
)
{
create
(
:diff_note_on_design
,
noteable:
design
,
project:
project
)
}
before
do
enable_design_management
...
...
ee/spec/requests/api/group_boards_spec.rb
View file @
0e4bf1a3
...
...
@@ -3,42 +3,42 @@
require
'spec_helper'
describe
API
::
GroupBoards
do
set
(
:user
)
{
create
(
:user
)
}
set
(
:non_member
)
{
create
(
:user
)
}
set
(
:guest
)
{
create
(
:user
)
}
set
(
:admin
)
{
create
(
:user
,
:admin
)
}
set
(
:board_parent
)
{
create
(
:group
,
:public
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:non_member
)
{
create
(
:user
)
}
let_it_be
(
:guest
)
{
create
(
:user
)
}
let_it_be
(
:admin
)
{
create
(
:user
,
:admin
)
}
let_it_be
(
:board_parent
)
{
create
(
:group
,
:public
)
}
before
do
board_parent
.
add_owner
(
user
)
end
set
(
:project
)
{
create
(
:project
,
:public
,
namespace:
board_parent
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:public
,
namespace:
board_parent
)
}
set
(
:dev_label
)
do
let_it_be
(
:dev_label
)
do
create
(
:group_label
,
title:
'Development'
,
color:
'#FFAABB'
,
group:
board_parent
)
end
set
(
:test_label
)
do
let_it_be
(
:test_label
)
do
create
(
:group_label
,
title:
'Testing'
,
color:
'#FFAACC'
,
group:
board_parent
)
end
set
(
:ux_label
)
do
let_it_be
(
:ux_label
)
do
create
(
:group_label
,
title:
'UX'
,
color:
'#FF0000'
,
group:
board_parent
)
end
set
(
:dev_list
)
do
let_it_be
(
:dev_list
)
do
create
(
:list
,
label:
dev_label
,
position:
1
)
end
set
(
:test_list
)
do
let_it_be
(
:test_list
)
do
create
(
:list
,
label:
test_label
,
position:
2
)
end
set
(
:milestone
)
{
create
(
:milestone
,
group:
board_parent
)
}
set
(
:board_label
)
{
create
(
:group_label
,
group:
board_parent
)
}
let_it_be
(
:milestone
)
{
create
(
:milestone
,
group:
board_parent
)
}
let_it_be
(
:board_label
)
{
create
(
:group_label
,
group:
board_parent
)
}
set
(
:board
)
do
let_it_be
(
:board
)
do
create
(
:board
,
group:
board_parent
,
milestone:
milestone
,
assignee:
user
,
...
...
ee/spec/requests/api/groups_spec.rb
View file @
0e4bf1a3
...
...
@@ -5,11 +5,11 @@ require 'spec_helper'
describe
API
::
Groups
do
include
GroupAPIHelpers
set
(
:group
)
{
create
(
:group
)
}
set
(
:private_group
)
{
create
(
:group
,
:private
)
}
set
(
:project
)
{
create
(
:project
,
group:
group
)
}
set
(
:user
)
{
create
(
:user
)
}
set
(
:another_user
)
{
create
(
:user
)
}
let_it_be
(
:group
,
reload:
true
)
{
create
(
:group
)
}
let_it_be
(
:private_group
)
{
create
(
:group
,
:private
)
}
let_it_be
(
:project
)
{
create
(
:project
,
group:
group
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:another_user
)
{
create
(
:user
)
}
let
(
:admin
)
{
create
(
:admin
)
}
before
do
...
...
ee/spec/requests/api/internal/base_spec.rb
View file @
0e4bf1a3
...
...
@@ -4,13 +4,13 @@ require 'spec_helper'
describe
API
::
Internal
::
Base
do
include
EE
::
GeoHelpers
set
(
:primary_nod
e
)
{
create
(
:geo_node
,
:primary
)
}
set
(
:secondary_nod
e
)
{
create
(
:geo_node
)
}
let_it_be
(
:primary_node
,
reload:
tru
e
)
{
create
(
:geo_node
,
:primary
)
}
let_it_be
(
:secondary_node
,
reload:
tru
e
)
{
create
(
:geo_node
)
}
describe
'POST /internal/post_receive'
,
:geo
do
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let
(
:key
)
{
create
(
:key
,
user:
user
)
}
set
(
:project
)
{
create
(
:project
,
:repository
,
:wiki_repo
)
}
let_it_be
(
:project
,
reload:
true
)
{
create
(
:project
,
:repository
,
:wiki_repo
)
}
let
(
:secret_token
)
{
Gitlab
::
Shell
.
secret_token
}
let
(
:gl_repository
)
{
"project-
#{
project
.
id
}
"
}
let
(
:reference_counter
)
{
double
(
'ReferenceCounter'
)
}
...
...
@@ -112,12 +112,12 @@ describe API::Internal::Base do
end
describe
"POST /internal/allowed"
do
set
(
:user
)
{
create
(
:user
)
}
set
(
:key
)
{
create
(
:key
,
user:
user
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:key
)
{
create
(
:key
,
user:
user
)
}
let
(
:secret_token
)
{
Gitlab
::
Shell
.
secret_token
}
context
"for design repositories"
do
set
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let
(
:gl_repository
)
{
EE
::
Gitlab
::
GlRepository
::
DESIGN
.
identifier_for_container
(
project
)
}
it
"does not allow access"
do
...
...
@@ -191,7 +191,7 @@ describe API::Internal::Base do
end
context
'smartcard session required'
do
set
(
:project
)
{
create
(
:project
,
:repository
,
:wiki_repo
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
,
:wiki_repo
)
}
subject
do
post
(
...
...
ee/spec/requests/api/issues_spec.rb
View file @
0e4bf1a3
...
...
@@ -3,17 +3,17 @@
require
'spec_helper'
describe
API
::
Issues
,
:mailer
do
set
(
:user
)
{
create
(
:user
)
}
set
(
:project
)
do
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
do
create
(
:project
,
:public
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
end
set
(
:group
)
{
create
(
:group
)
}
set
(
:epic
)
{
create
(
:epic
,
group:
group
)
}
set
(
:group_project
)
{
create
(
:project
,
:public
,
creator_id:
user
.
id
,
namespace:
group
)
}
let_it_be
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:epic
)
{
create
(
:epic
,
group:
group
)
}
let_it_be
(
:group_project
)
{
create
(
:project
,
:public
,
creator_id:
user
.
id
,
namespace:
group
)
}
let
(
:user2
)
{
create
(
:user
)
}
set
(
:author
)
{
create
(
:author
)
}
set
(
:assignee
)
{
create
(
:assignee
)
}
let
(
:user2
)
{
create
(
:user
)
}
let_it_be
(
:author
)
{
create
(
:author
)
}
let_it_be
(
:assignee
)
{
create
(
:assignee
)
}
let
(
:issue_title
)
{
'foo'
}
let
(
:issue_description
)
{
'closed'
}
let!
(
:issue
)
do
...
...
@@ -28,7 +28,7 @@ describe API::Issues, :mailer do
description:
issue_description
end
set
(
:milestone
)
{
create
(
:milestone
,
title:
'1.0.0'
,
project:
project
)
}
let_it_be
(
:milestone
)
{
create
(
:milestone
,
title:
'1.0.0'
,
project:
project
)
}
before
(
:all
)
do
project
.
add_reporter
(
user
)
...
...
ee/spec/requests/api/jobs_spec.rb
View file @
0e4bf1a3
...
...
@@ -3,11 +3,11 @@
require
'spec_helper'
describe
API
::
Jobs
do
set
(
:project
)
do
let_it_be
(
:project
)
do
create
(
:project
,
:repository
,
public_builds:
false
)
end
set
(
:pipeline
)
do
let_it_be
(
:pipeline
)
do
create
(
:ci_empty_pipeline
,
project:
project
,
sha:
project
.
commit
.
id
,
ref:
project
.
default_branch
)
...
...
ee/spec/requests/api/ldap_spec.rb
View file @
0e4bf1a3
...
...
@@ -6,8 +6,8 @@ describe API::Ldap do
include
ApiHelpers
include
LdapHelpers
set
(
:user
)
{
create
(
:user
)
}
set
(
:admin
)
{
create
(
:admin
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:admin
)
{
create
(
:admin
)
}
let
(
:adapter
)
{
ldap_adapter
}
before
do
...
...
ee/spec/requests/api/managed_licenses_spec.rb
View file @
0e4bf1a3
...
...
@@ -3,11 +3,11 @@
require
'spec_helper'
describe
API
::
ManagedLicenses
do
set
(
:project
)
{
create
(
:project
,
:public
)
}
set
(
:maintainer_user
)
{
create
(
:user
)
}
set
(
:dev_user
)
{
create
(
:user
)
}
set
(
:reporter_user
)
{
create
(
:user
)
}
set
(
:software_license_policy
)
{
create
(
:software_license_policy
,
project:
project
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:public
)
}
let_it_be
(
:maintainer_user
)
{
create
(
:user
)
}
let_it_be
(
:dev_user
)
{
create
(
:user
)
}
let_it_be
(
:reporter_user
)
{
create
(
:user
)
}
let_it_be
(
:software_license_policy
)
{
create
(
:software_license_policy
,
project:
project
)
}
before
do
stub_licensed_features
(
license_management:
true
)
...
...
ee/spec/requests/api/merge_request_approval_rules_spec.rb
View file @
0e4bf1a3
...
...
@@ -3,9 +3,9 @@
require
'spec_helper'
describe
API
::
MergeRequestApprovalRules
do
set
(
:user
)
{
create
(
:user
)
}
set
(
:other_user
)
{
create
(
:user
)
}
set
(
:project
)
{
create
(
:project
,
:public
,
:repository
,
creator:
user
,
namespace:
user
.
namespace
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:other_user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:public
,
:repository
,
creator:
user
,
namespace:
user
.
namespace
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
author:
user
,
source_project:
project
,
target_project:
project
)
}
shared_examples_for
'a protected API endpoint for merge request approval rule action'
do
...
...
ee/spec/requests/api/merge_request_approvals_spec.rb
View file @
0e4bf1a3
...
...
@@ -3,15 +3,14 @@
require
'spec_helper'
describe
API
::
MergeRequestApprovals
do
set
(
:user
)
{
create
(
:user
)
}
set
(
:user2
)
{
create
(
:user
)
}
set
(
:admin
)
{
create
(
:user
,
:admin
)
}
set
(
:project
)
{
create
(
:project
,
:public
,
:repository
,
creator:
user
,
namespace:
user
.
namespace
,
only_allow_merge_if_pipeline_succeeds:
false
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:user2
)
{
create
(
:user
)
}
let_it_be
(
:admin
)
{
create
(
:user
,
:admin
)
}
let_it_be
(
:project
,
reload:
true
)
{
create
(
:project
,
:public
,
:repository
,
creator:
user
,
namespace:
user
.
namespace
,
only_allow_merge_if_pipeline_succeeds:
false
)
}
let_it_be
(
:approver
)
{
create
:user
}
let_it_be
(
:group
)
{
create
:group
}
let
(
:merge_request
)
{
create
(
:merge_request
,
:simple
,
author:
user
,
assignees:
[
user
],
source_project:
project
,
target_project:
project
,
title:
"Test"
,
created_at:
Time
.
now
)
}
set
(
:approver
)
{
create
:user
}
set
(
:group
)
{
create
:group
}
shared_examples_for
'an API endpoint for getting merge request approval state'
do
context
'when source rule is present'
do
let
(
:source_rule
)
{
create
(
:approval_project_rule
,
project:
project
,
approvals_required:
1
,
name:
'zoo'
)
}
...
...
@@ -378,7 +377,7 @@ describe API::MergeRequestApprovals do
end
context
'as a valid approver'
do
set
(
:approver
)
{
create
(
:user
)
}
let_it_be
(
:approver
)
{
create
(
:user
)
}
before
do
project
.
add_developer
(
approver
)
...
...
@@ -481,8 +480,8 @@ describe API::MergeRequestApprovals do
let!
(
:rule
)
{
create
(
:approval_merge_request_rule
,
merge_request:
merge_request
,
approvals_required:
2
,
name:
'foo'
)
}
context
'as a user who has approved the merge request'
do
set
(
:approver
)
{
create
(
:user
)
}
set
(
:unapprover
)
{
create
(
:user
)
}
let_it_be
(
:approver
)
{
create
(
:user
)
}
let_it_be
(
:unapprover
)
{
create
(
:user
)
}
before
do
project
.
add_developer
(
approver
)
...
...
ee/spec/requests/api/namespaces_spec.rb
View file @
0e4bf1a3
...
...
@@ -243,11 +243,11 @@ describe API::Namespaces do
get
api
(
"/namespaces/
#{
namespace
.
id
}
/gitlab_subscription"
,
current_user
)
end
set
(
:silver_plan
)
{
create
(
:silver_plan
)
}
set
(
:owner
)
{
create
(
:user
)
}
set
(
:developer
)
{
create
(
:user
)
}
set
(
:namespace
)
{
create
(
:group
)
}
set
(
:gitlab_subscription
)
{
create
(
:gitlab_subscription
,
hosted_plan:
silver_plan
,
namespace:
namespace
)
}
let_it_be
(
:silver_plan
)
{
create
(
:silver_plan
)
}
let_it_be
(
:owner
)
{
create
(
:user
)
}
let_it_be
(
:developer
)
{
create
(
:user
)
}
let_it_be
(
:namespace
)
{
create
(
:group
)
}
let_it_be
(
:gitlab_subscription
)
{
create
(
:gitlab_subscription
,
hosted_plan:
silver_plan
,
namespace:
namespace
)
}
before
do
namespace
.
add_owner
(
owner
)
...
...
@@ -295,8 +295,9 @@ describe API::Namespaces do
put
api
(
"/namespaces/
#{
namespace_id
}
/gitlab_subscription"
,
current_user
),
params:
payload
end
set
(
:namespace
)
{
create
(
:group
,
name:
'test.test-group.22'
)
}
set
(
:gitlab_subscription
)
{
create
(
:gitlab_subscription
,
namespace:
namespace
)
}
let_it_be
(
:silver_plan
)
{
create
(
:silver_plan
)
}
let_it_be
(
:namespace
)
{
create
(
:group
,
name:
'test.test-group.22'
)
}
let_it_be
(
:gitlab_subscription
)
{
create
(
:gitlab_subscription
,
namespace:
namespace
)
}
let
(
:params
)
do
{
...
...
@@ -325,7 +326,7 @@ describe API::Namespaces do
end
context
'when namespace does not have a subscription'
do
set
(
:namespace_2
)
{
create
(
:group
)
}
let_it_be
(
:namespace_2
)
{
create
(
:group
)
}
it
'returns a 404 error'
do
do_put
(
namespace_2
.
id
,
admin
,
params
)
...
...
ee/spec/requests/api/project_approval_rules_spec.rb
View file @
0e4bf1a3
...
...
@@ -3,12 +3,12 @@
require
'spec_helper'
describe
API
::
ProjectApprovalRules
do
set
(
:group
)
{
create
(
:group_with_members
)
}
set
(
:user
)
{
create
(
:user
)
}
set
(
:user2
)
{
create
(
:user
)
}
set
(
:admin
)
{
create
(
:user
,
:admin
)
}
set
(
:project
)
{
create
(
:project
,
:public
,
:repository
,
creator:
user
,
namespace:
user
.
namespace
,
only_allow_merge_if_pipeline_succeeds:
false
)
}
set
(
:approver
)
{
create
(
:user
)
}
let_it_be
(
:group
)
{
create
(
:group_with_members
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:user2
)
{
create
(
:user
)
}
let_it_be
(
:admin
)
{
create
(
:user
,
:admin
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:public
,
:repository
,
creator:
user
,
namespace:
user
.
namespace
,
only_allow_merge_if_pipeline_succeeds:
false
)
}
let_it_be
(
:approver
)
{
create
(
:user
)
}
describe
'GET /projects/:id/approval_rules'
do
let
(
:url
)
{
"/projects/
#{
project
.
id
}
/approval_rules"
}
...
...
@@ -43,7 +43,7 @@ describe API::ProjectApprovalRules do
end
context
'private group filtering'
do
set
(
:private_group
)
{
create
:group
,
:private
}
let_it_be
(
:private_group
)
{
create
:group
,
:private
}
before
do
rule
.
groups
<<
private_group
...
...
ee/spec/requests/api/project_approval_settings_spec.rb
View file @
0e4bf1a3
...
...
@@ -3,12 +3,12 @@
require
'spec_helper'
describe
API
::
ProjectApprovalSettings
do
set
(
:group
)
{
create
(
:group_with_members
)
}
set
(
:user
)
{
create
(
:user
)
}
set
(
:user2
)
{
create
(
:user
)
}
set
(
:admin
)
{
create
(
:user
,
:admin
)
}
set
(
:project
)
{
create
(
:project
,
:public
,
:repository
,
creator:
user
,
namespace:
user
.
namespace
,
only_allow_merge_if_pipeline_succeeds:
false
)
}
set
(
:approver
)
{
create
(
:user
)
}
let_it_be
(
:group
)
{
create
(
:group_with_members
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:user2
)
{
create
(
:user
)
}
let_it_be
(
:admin
)
{
create
(
:user
,
:admin
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:public
,
:repository
,
creator:
user
,
namespace:
user
.
namespace
,
only_allow_merge_if_pipeline_succeeds:
false
)
}
let_it_be
(
:approver
)
{
create
(
:user
)
}
describe
'GET /projects/:id/approval_settings'
do
let
(
:url
)
{
"/projects/
#{
project
.
id
}
/approval_settings"
}
...
...
@@ -43,7 +43,7 @@ describe API::ProjectApprovalSettings do
end
context
'private group filtering'
do
set
(
:private_group
)
{
create
:group
,
:private
}
let_it_be
(
:private_group
)
{
create
:group
,
:private
}
before
do
rule
.
groups
<<
private_group
...
...
ee/spec/requests/api/project_approvals_spec.rb
View file @
0e4bf1a3
...
...
@@ -3,12 +3,12 @@
require
'spec_helper'
describe
API
::
ProjectApprovals
do
set
(
:group
)
{
create
(
:group_with_members
)
}
set
(
:user
)
{
create
(
:user
)
}
set
(
:user2
)
{
create
(
:user
)
}
set
(
:admin
)
{
create
(
:user
,
:admin
)
}
set
(
:project
)
{
create
(
:project
,
:public
,
:repository
,
creator:
user
,
namespace:
user
.
namespace
,
only_allow_merge_if_pipeline_succeeds:
false
)
}
set
(
:approver
)
{
create
(
:user
)
}
let_it_be
(
:group
)
{
create
(
:group_with_members
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:user2
)
{
create
(
:user
)
}
let_it_be
(
:admin
)
{
create
(
:user
,
:admin
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:public
,
:repository
,
creator:
user
,
namespace:
user
.
namespace
,
only_allow_merge_if_pipeline_succeeds:
false
)
}
let_it_be
(
:approver
)
{
create
(
:user
)
}
let
(
:url
)
{
"/projects/
#{
project
.
id
}
/approvals"
}
...
...
ee/spec/requests/api/resource_label_events_spec.rb
View file @
0e4bf1a3
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
describe
API
::
ResourceLabelEvents
do
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
before
do
parent
.
add_developer
(
user
)
...
...
ee/spec/requests/api/runner_spec.rb
View file @
0e4bf1a3
...
...
@@ -6,7 +6,7 @@ describe API::Runner, :clean_gitlab_redis_shared_state do
include
StubGitlabCalls
include
RedisHelpers
set
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
describe
'/api/v4/jobs'
do
let
(
:runner
)
{
create
(
:ci_runner
,
:project
,
projects:
[
project
])
}
...
...
ee/spec/requests/api/search_spec.rb
View file @
0e4bf1a3
...
...
@@ -3,8 +3,8 @@
require
'spec_helper'
describe
API
::
Search
do
set
(
:user
)
{
create
(
:user
)
}
set
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:group
)
{
create
(
:group
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
,
:wiki_repo
,
name:
'awesome project'
,
group:
group
)
}
shared_examples
'response is correct'
do
|
schema
:,
size:
1
|
...
...
ee/spec/requests/api/services_spec.rb
View file @
0e4bf1a3
...
...
@@ -3,9 +3,9 @@
require
"spec_helper"
describe
API
::
Services
do
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
set
(
:project
)
do
let_it_be
(
:project
)
do
create
(
:project
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
end
...
...
ee/spec/requests/api/templates_spec.rb
View file @
0e4bf1a3
...
...
@@ -10,7 +10,7 @@ describe API::Templates do
'LICENSE/custom.txt'
=>
'Custom licenses'
}
set
(
:project
)
{
create
(
:project
,
:custom_repo
,
files:
files
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:custom_repo
,
files:
files
)
}
before
do
stub_ee_application_setting
(
file_template_project:
project
)
...
...
ee/spec/requests/api/todos_spec.rb
View file @
0e4bf1a3
...
...
@@ -3,12 +3,11 @@
require
'spec_helper'
describe
API
::
Todos
do
set
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:project
)
{
create
(
:project
,
group:
group
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:epic
)
{
create
(
:epic
,
group:
group
)
}
set
(
:project
)
{
create
(
:project
,
group:
group
)
}
describe
'GET /todos'
do
let
(
:author_1
)
{
create
(
:user
)
}
let!
(
:pat
)
{
create
(
:personal_access_token
,
user:
user
)
}
...
...
ee/spec/requests/api/unleash_spec.rb
View file @
0e4bf1a3
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
describe
API
::
Unleash
do
include
FeatureFlagHelpers
set
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let
(
:project_id
)
{
project
.
id
}
let
(
:feature_enabled
)
{
true
}
let
(
:params
)
{
}
...
...
ee/spec/requests/git_http_geo_spec.rb
View file @
0e4bf1a3
...
...
@@ -9,9 +9,9 @@ describe "Git HTTP requests (Geo)", :geo do
include
WorkhorseHelpers
using
RSpec
::
Parameterized
::
TableSyntax
set
(
:project
)
{
create
(
:project
,
:repository
,
:private
)
}
set
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
set
(
:secondary
)
{
create
(
:geo_node
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
,
:private
)
}
let_it_be
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
let_it_be
(
:secondary
)
{
create
(
:geo_node
)
}
# Ensure the token always comes from the real time of the request
let
(
:auth_token
)
{
Gitlab
::
Geo
::
BaseRequest
.
new
(
scope:
project
.
full_path
).
authorization
}
...
...
@@ -83,7 +83,7 @@ describe "Git HTTP requests (Geo)", :geo do
context
'when current node is a secondary'
do
let
(
:current_node
)
{
secondary
}
set
(
:project
)
{
create
(
:project
,
:repository
,
:private
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
,
:private
)
}
describe
'GET info_refs'
do
context
'git pull'
do
...
...
ee/spec/requests/repositories/git_http_controller_spec.rb
View file @
0e4bf1a3
...
...
@@ -6,8 +6,8 @@ describe Repositories::GitHttpController, type: :request do
include
GitHttpHelpers
describe
'GET #info_refs'
do
set
(
:user
)
{
create
(
:user
)
}
set
(
:project
)
{
create
(
:project
,
:repository
,
:private
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
,
:private
)
}
let
(
:path
)
{
"
#{
project
.
full_path
}
.git"
}
let
(
:env
)
{
{
user:
user
.
username
,
password:
user
.
password
}
}
...
...
ee/spec/serializers/clusters/environment_entity_spec.rb
View file @
0e4bf1a3
...
...
@@ -3,10 +3,10 @@
require
'spec_helper'
describe
Clusters
::
EnvironmentEntity
do
set
(
:user
)
{
create
(
:user
)
}
set
(
:group
)
{
create
(
:group
)
}
set
(
:project
)
{
create
(
:project
,
group:
group
)
}
set
(
:cluster
)
{
create
(
:cluster_for_group
,
groups:
[
group
])
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:project
)
{
create
(
:project
,
group:
group
)
}
let_it_be
(
:cluster
)
{
create
(
:cluster_for_group
,
groups:
[
group
])
}
it
'inherits from API::Entities::EnvironmentBasic'
do
expect
(
described_class
).
to
be
<
API
::
Entities
::
EnvironmentBasic
...
...
ee/spec/serializers/clusters/environment_serializer_spec.rb
View file @
0e4bf1a3
...
...
@@ -5,10 +5,9 @@ require 'spec_helper'
describe
Clusters
::
EnvironmentSerializer
do
include
KubernetesHelpers
set
(
:user
)
{
create
(
:user
)
}
set
(
:project
)
{
create
(
:project
,
namespace:
user
.
namespace
)
}
set
(
:cluster
)
{
create
(
:cluster
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
,
namespace:
user
.
namespace
)
}
let_it_be
(
:cluster
)
{
create
(
:cluster
)
}
let
(
:resource
)
{
create
(
:environment
,
project:
project
)
}
let
(
:json_entity
)
do
...
...
ee/spec/serializers/dependency_entity_spec.rb
View file @
0e4bf1a3
...
...
@@ -6,7 +6,7 @@ describe DependencyEntity do
describe
'#as_json'
do
subject
{
described_class
.
represent
(
dependency
,
request:
request
).
as_json
}
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
:private
)
}
let
(
:request
)
{
double
(
'request'
)
}
let
(
:dependency
)
{
build
(
:dependency
,
:with_vulnerabilities
,
:with_licenses
)
}
...
...
ee/spec/serializers/dependency_list_serializer_spec.rb
View file @
0e4bf1a3
...
...
@@ -3,8 +3,8 @@
require
'spec_helper'
describe
DependencyListSerializer
do
set
(
:project
)
{
create
(
:project
,
:repository
,
:private
)
}
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
,
:private
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let
(
:ci_build
)
{
create
(
:ee_ci_build
,
:success
)
}
let
(
:dependencies
)
{
[
build
(
:dependency
,
:with_vulnerabilities
,
:with_licenses
)]
}
...
...
ee/spec/serializers/merge_request_poll_widget_entity_spec.rb
View file @
0e4bf1a3
...
...
@@ -5,9 +5,9 @@ require 'spec_helper'
describe
MergeRequestPollWidgetEntity
do
include
ProjectForksHelper
set
(
:user
)
{
create
(
:user
)
}
set
(
:project
)
{
create
:project
,
:repository
}
set
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
,
target_project:
project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
:project
,
:repository
}
let_it_be
(
:merge_request
,
reload:
true
)
{
create
(
:merge_request
,
source_project:
project
,
target_project:
project
)
}
let
(
:request
)
{
double
(
'request'
,
current_user:
user
)
}
before
do
...
...
ee/spec/serializers/merge_request_widget_entity_spec.rb
View file @
0e4bf1a3
...
...
@@ -5,10 +5,10 @@ require 'spec_helper'
describe
MergeRequestWidgetEntity
do
include
ProjectForksHelper
set
(
:user
)
{
create
(
:user
)
}
set
(
:project
)
{
create
:project
,
:repository
}
set
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
,
target_project:
project
)
}
set
(
:pipelin
e
)
{
create
(
:ci_empty_pipeline
,
project:
project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
,
reload:
true
)
{
create
:project
,
:repository
}
let_it_be
(
:merge_request
,
reload:
true
)
{
create
(
:merge_request
,
source_project:
project
,
target_project:
project
)
}
let_it_be
(
:pipeline
,
reload:
tru
e
)
{
create
(
:ci_empty_pipeline
,
project:
project
)
}
let
(
:request
)
{
double
(
'request'
,
current_user:
user
)
}
before
do
...
...
@@ -226,7 +226,7 @@ describe MergeRequestWidgetEntity do
end
describe
'blocking merge requests'
do
set
(
:merge_request_block
)
{
create
(
:merge_request_block
,
blocked_merge_request:
merge_request
)
}
let_it_be
(
:merge_request_block
)
{
create
(
:merge_request_block
,
blocked_merge_request:
merge_request
)
}
let
(
:blocking_mr
)
{
merge_request_block
.
blocking_merge_request
}
...
...
ee/spec/serializers/pipeline_serializer_spec.rb
View file @
0e4bf1a3
...
...
@@ -3,8 +3,8 @@
require
'spec_helper'
describe
PipelineSerializer
do
set
(
:project
)
{
create
(
:project
,
:repository
)
}
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let
(
:serializer
)
do
described_class
.
new
(
current_user:
user
)
...
...
ee/spec/serializers/vulnerabilities/feedback_entity_spec.rb
View file @
0e4bf1a3
...
...
@@ -3,8 +3,8 @@
require
'spec_helper'
describe
Vulnerabilities
::
FeedbackEntity
do
set
(
:user
)
{
create
(
:user
)
}
set
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let
(
:request
)
{
double
(
'request'
)
}
let
(
:entity
)
{
described_class
.
represent
(
feedback
,
request:
request
)
}
...
...
ee/spec/serializers/vulnerabilities/occurrence_entity_spec.rb
View file @
0e4bf1a3
...
...
@@ -3,8 +3,8 @@
require
'spec_helper'
describe
Vulnerabilities
::
OccurrenceEntity
do
set
(
:user
)
{
create
(
:user
)
}
set
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let
(
:scanner
)
do
create
(
:vulnerabilities_scanner
,
project:
project
)
...
...
ee/spec/serializers/vulnerabilities/occurrence_reports_comparer_entity_spec.rb
View file @
0e4bf1a3
...
...
@@ -4,7 +4,7 @@ require 'spec_helper'
describe
Vulnerabilities
::
OccurrenceReportsComparerEntity
do
describe
'container scanning report comparison'
do
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let
(
:base_occurrences
)
{
create_list
(
:vulnerabilities_occurrence
,
2
)
}
let
(
:base_combined_reports
)
{
build_list
(
:ci_reports_security_report
,
1
,
created_at:
nil
)
}
...
...
ee/spec/support/shared_examples/features/insights_shared_examples.rb
View file @
0e4bf1a3
# frozen_string_literal: true
RSpec
.
shared_examples
'Insights page'
do
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
context
'as a permitted user'
do
before
(
:context
)
do
...
...
ee/spec/support/shared_examples/models/concerns/elastic/limited_indexing_shared_examples.rb
View file @
0e4bf1a3
# frozen_string_literal: true
RSpec
.
shared_examples
'limited indexing is enabled'
do
set
(
:project
)
{
create
:project
,
:repository
,
name:
'test1'
}
let_it_be
(
:project
)
{
create
:project
,
:repository
,
name:
'test1'
}
before
do
stub_ee_application_setting
(
elasticsearch_limit_indexing:
true
)
...
...
ee/spec/support/shared_examples/serializers/report_status_shared_examples.rb
View file @
0e4bf1a3
...
...
@@ -8,8 +8,8 @@ RSpec.shared_examples 'report list' do
let
(
:request
)
{
double
(
'request'
)
}
set
(
:project
)
{
create
(
:project
,
:repository
,
:private
)
}
set
(
:developer
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
,
:private
)
}
let_it_be
(
:developer
)
{
create
(
:user
)
}
subject
{
entity
.
as_json
}
...
...
ee/spec/tasks/geo/git_rake_spec.rb
View file @
0e4bf1a3
...
...
@@ -3,8 +3,8 @@
require
'rake_helper'
describe
'geo:git:housekeeping'
do
set
(
:project
)
{
create
(
:project
,
:repository
)
}
set
(
:registry
)
{
::
Geo
::
ProjectRegistry
.
find_or_create_by!
(
project:
project
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:registry
)
{
::
Geo
::
ProjectRegistry
.
find_or_create_by!
(
project:
project
)
}
shared_examples
'housekeeping task'
do
|
task_name
,
period_name
|
it
"sets existing projects syncs_gc count to
#{
period_name
}
-1"
do
...
...
ee/spec/views/admin/application_settings/_elasticsearch_form.html.haml_spec.rb
View file @
0e4bf1a3
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
describe
'admin/application_settings/_elasticsearch_form'
do
set
(
:admin
)
{
create
(
:admin
)
}
let_it_be
(
:admin
)
{
create
(
:admin
)
}
let
(
:page
)
{
Capybara
::
Node
::
Simple
.
new
(
rendered
)
}
before
do
...
...
ee/spec/views/admin/groups/_form.html.haml_spec.rb
View file @
0e4bf1a3
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
describe
'admin/groups/_form'
do
set
(
:admin
)
{
create
(
:admin
)
}
let_it_be
(
:admin
)
{
create
(
:admin
)
}
before
do
assign
(
:group
,
group
)
...
...
ee/spec/views/clusters/clusters/show.html.haml_spec.rb
View file @
0e4bf1a3
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
describe
'clusters/clusters/show'
do
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
shared_examples
'cluster health section'
do
let
(
:cluster_presenter
)
{
cluster
.
present
(
current_user:
user
)
}
...
...
ee/spec/views/groups/edit.html.haml_spec.rb
View file @
0e4bf1a3
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
describe
'groups/edit.html.haml'
do
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let
(
:group
)
{
create
(
:group
)
}
before
do
...
...
ee/spec/views/projects/pipelines/_tabs_content.html.haml_spec.rb
View file @
0e4bf1a3
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
describe
'projects/pipelines/_tabs_content'
do
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let
(
:pipeline
)
{
create
(
:ci_pipeline
).
present
(
current_user:
user
)
}
let
(
:locals
)
{
{
pipeline:
pipeline
,
project:
pipeline
.
project
}
}
...
...
ee/spec/views/shared/_clone_panel.html.haml_spec.rb
View file @
0e4bf1a3
...
...
@@ -5,9 +5,9 @@ require 'spec_helper'
describe
'shared/_clone_panel'
do
include
EE
::
GeoHelpers
set
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
set
(
:secondary
)
{
create
(
:geo_node
)
}
set
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
let_it_be
(
:secondary
)
{
create
(
:geo_node
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
shared_examples
'has no geo-specific instructions'
do
it
'has no geo-specific instructions'
do
...
...
ee/spec/workers/ci/create_cross_project_pipeline_worker_spec.rb
View file @
0e4bf1a3
...
...
@@ -3,9 +3,9 @@
require
'spec_helper'
describe
Ci
::
CreateCrossProjectPipelineWorker
do
set
(
:user
)
{
create
(
:user
)
}
set
(
:project
)
{
create
(
:project
)
}
set
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
)
}
let
(
:bridge
)
{
create
(
:ci_bridge
,
user:
user
,
pipeline:
pipeline
)
}
let
(
:service
)
{
double
(
'pipeline creation service'
)
}
...
...
ee/spec/workers/design_management/new_version_worker_spec.rb
View file @
0e4bf1a3
...
...
@@ -24,7 +24,7 @@ describe DesignManagement::NewVersionWorker do
end
context
'the version id is valid'
do
set
(
:version
)
{
create
(
:design_version
,
:committed
,
designs_count:
2
)
}
let_it_be
(
:version
)
{
create
(
:design_version
,
:committed
,
designs_count:
2
)
}
it
'creates a system note'
do
expect
{
worker
.
perform
(
version
.
id
)
}.
to
change
{
Note
.
system
.
count
}.
by
(
1
)
...
...
@@ -38,7 +38,7 @@ describe DesignManagement::NewVersionWorker do
end
context
'the version includes multiple types of action'
do
set
(
:version
)
do
let_it_be
(
:version
)
do
create
(
:design_version
,
:committed
,
created_designs:
create_list
(
:design
,
1
),
modified_designs:
create_list
(
:design
,
1
))
...
...
ee/spec/workers/ee/repository_check/batch_worker_spec.rb
View file @
0e4bf1a3
...
...
@@ -14,7 +14,7 @@ describe EE::RepositoryCheck::BatchWorker do
end
context
'Geo primary'
do
set
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
let_it_be
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
before
do
stub_current_geo_node
(
primary
)
...
...
@@ -28,7 +28,7 @@ describe EE::RepositoryCheck::BatchWorker do
end
context
'Geo secondary'
do
set
(
:secondary
)
{
create
(
:geo_node
)
}
let_it_be
(
:secondary
)
{
create
(
:geo_node
)
}
before
do
stub_current_geo_node
(
secondary
)
...
...
ee/spec/workers/ee/repository_check/single_repository_worker_spec.rb
View file @
0e4bf1a3
...
...
@@ -5,12 +5,12 @@ require 'spec_helper'
describe
EE
::
RepositoryCheck
::
SingleRepositoryWorker
do
include
::
EE
::
GeoHelpers
set
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
subject
(
:worker
)
{
RepositoryCheck
::
SingleRepositoryWorker
.
new
}
context
'Geo primary'
do
set
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
let_it_be
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
before
do
stub_current_geo_node
(
primary
)
...
...
@@ -26,8 +26,8 @@ describe EE::RepositoryCheck::SingleRepositoryWorker do
end
context
'Geo secondary'
do
set
(
:project_registry
)
{
create
(
:geo_project_registry
,
project:
project
)
}
set
(
:secondary
)
{
create
(
:geo_node
)
}
let_it_be
(
:project_registry
)
{
create
(
:geo_project_registry
,
project:
project
)
}
let_it_be
(
:secondary
)
{
create
(
:geo_node
)
}
before
do
stub_current_geo_node
(
secondary
)
...
...
ee/spec/workers/elastic_namespace_indexer_worker_spec.rb
View file @
0e4bf1a3
...
...
@@ -27,7 +27,7 @@ describe ElasticNamespaceIndexerWorker, :elastic do
end
describe
'indexing and deleting'
do
set
(
:namespace
)
{
create
:namespace
}
let_it_be
(
:namespace
)
{
create
:namespace
}
let
(
:projects
)
{
create_list
:project
,
3
,
namespace:
namespace
}
it
'indexes all projects belonging to the namespace'
do
...
...
ee/spec/workers/geo/batch/project_registry_scheduler_worker_spec.rb
View file @
0e4bf1a3
...
...
@@ -6,7 +6,7 @@ RSpec.describe Geo::Batch::ProjectRegistrySchedulerWorker do
include
ExclusiveLeaseHelpers
include
::
EE
::
GeoHelpers
set
(
:secondary
)
{
create
(
:geo_node
)
}
let_it_be
(
:secondary
)
{
create
(
:geo_node
)
}
let
(
:lease_key
)
{
subject
.
lease_key
}
let
(
:lease_timeout
)
{
2
.
minutes
}
...
...
ee/spec/workers/geo/batch/project_registry_worker_spec.rb
View file @
0e4bf1a3
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec
.
describe
Geo
::
Batch
::
ProjectRegistryWorker
do
include
::
EE
::
GeoHelpers
set
(
:secondary
)
{
create
(
:geo_node
)
}
let_it_be
(
:secondary
)
{
create
(
:geo_node
)
}
before
do
stub_current_geo_node
(
secondary
)
...
...
ee/spec/workers/geo/prune_event_log_worker_spec.rb
View file @
0e4bf1a3
...
...
@@ -7,8 +7,8 @@ describe Geo::PruneEventLogWorker, :geo do
subject
(
:worker
)
{
described_class
.
new
}
set
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
set
(
:secondary
)
{
create
(
:geo_node
)
}
let_it_be
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
let_it_be
(
:secondary
,
refind:
true
)
{
create
(
:geo_node
)
}
describe
'#perform'
do
context
'current node secondary'
do
...
...
@@ -90,7 +90,7 @@ describe Geo::PruneEventLogWorker, :geo do
end
context
'multiple secondary nodes'
do
set
(
:secondary2
)
{
create
(
:geo_node
)
}
let_it_be
(
:secondary2
)
{
create
(
:geo_node
)
}
let!
(
:events
)
{
create_list
(
:geo_event_log
,
5
,
:updated_event
)
}
it
'aborts when there is a node without status'
do
...
...
ee/spec/workers/geo/repository_cleanup_worker_spec.rb
View file @
0e4bf1a3
...
...
@@ -6,9 +6,9 @@ describe Geo::RepositoryCleanupWorker, :geo do
include
::
EE
::
GeoHelpers
describe
'#perform'
do
set
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
set
(
:secondary
)
{
create
(
:geo_node
)
}
set
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
let_it_be
(
:secondary
)
{
create
(
:geo_node
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
before
do
stub_current_geo_node
(
secondary
)
...
...
ee/spec/workers/geo/repository_verification/primary/batch_worker_spec.rb
View file @
0e4bf1a3
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
describe
Geo
::
RepositoryVerification
::
Primary
::
BatchWorker
,
:clean_gitlab_redis_cache
do
include
::
EE
::
GeoHelpers
set
(
:healthy_not_verified
)
{
create
(
:project
)
}
let_it_be
(
:healthy_not_verified
)
{
create
(
:project
)
}
let!
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
let
(
:healthy_shard
)
{
healthy_not_verified
.
repository
.
storage
}
...
...
ee/spec/workers/geo/repository_verification/primary/single_worker_spec.rb
View file @
0e4bf1a3
...
...
@@ -6,8 +6,7 @@ describe Geo::RepositoryVerification::Primary::SingleWorker, :clean_gitlab_redis
include
::
EE
::
GeoHelpers
include
ExclusiveLeaseHelpers
set
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let!
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
before
do
...
...
ee/spec/workers/geo/repository_verification/secondary/scheduler_worker_spec.rb
View file @
0e4bf1a3
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
describe
Geo
::
RepositoryVerification
::
Secondary
::
SchedulerWorker
,
:clean_gitlab_redis_cache
do
include
::
EE
::
GeoHelpers
set
(
:healthy_not_verified
)
{
create
(
:project
)
}
let_it_be
(
:healthy_not_verified
)
{
create
(
:project
)
}
let!
(
:secondary
)
{
create
(
:geo_node
)
}
let
(
:healthy_shard
)
{
healthy_not_verified
.
repository
.
storage
}
...
...
ee/spec/workers/incident_management/process_alert_worker_spec.rb
View file @
0e4bf1a3
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
describe
IncidentManagement
::
ProcessAlertWorker
do
set
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
describe
'#perform'
do
let
(
:alert
)
{
:alert
}
...
...
ee/spec/workers/jira_connect/sync_branch_worker_spec.rb
View file @
0e4bf1a3
...
...
@@ -4,7 +4,7 @@ require 'spec_helper'
describe
JiraConnect
::
SyncBranchWorker
do
describe
'#perform'
do
set
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:project_id
)
{
project
.
id
}
let
(
:branch_name
)
{
'master'
}
let
(
:commit_shas
)
{
%w(b83d6e3 5a62481)
}
...
...
ee/spec/workers/remove_unreferenced_lfs_objects_worker_spec.rb
View file @
0e4bf1a3
...
...
@@ -7,8 +7,8 @@ describe RemoveUnreferencedLfsObjectsWorker do
describe
'#perform'
do
context
'when running in a Geo primary node'
do
set
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
set
(
:secondary
)
{
create
(
:geo_node
)
}
let_it_be
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
let_it_be
(
:secondary
)
{
create
(
:geo_node
)
}
it
'logs an event to the Geo event log for every unreferenced LFS objects'
do
stub_current_geo_node
(
primary
)
...
...
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