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
78ab2fc3
Commit
78ab2fc3
authored
Feb 19, 2020
by
Vitali Tatarintev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace set with let_it_be in spec/lib
Removes usage of `set` in specs
parent
0613aa98
Changes
53
Hide whitespace changes
Inline
Side-by-side
Showing
53 changed files
with
98 additions
and
113 deletions
+98
-113
spec/lib/banzai/filter/inline_metrics_redactor_filter_spec.rb
.../lib/banzai/filter/inline_metrics_redactor_filter_spec.rb
+1
-2
spec/lib/banzai/pipeline/gfm_pipeline_spec.rb
spec/lib/banzai/pipeline/gfm_pipeline_spec.rb
+1
-1
spec/lib/event_filter_spec.rb
spec/lib/event_filter_spec.rb
+10
-11
spec/lib/gitlab/auth_spec.rb
spec/lib/gitlab/auth_spec.rb
+1
-2
spec/lib/gitlab/checks/force_push_spec.rb
spec/lib/gitlab/checks/force_push_spec.rb
+1
-1
spec/lib/gitlab/ci/build/policy/changes_spec.rb
spec/lib/gitlab/ci/build/policy/changes_spec.rb
+3
-2
spec/lib/gitlab/ci/build/policy/kubernetes_spec.rb
spec/lib/gitlab/ci/build/policy/kubernetes_spec.rb
+1
-1
spec/lib/gitlab/ci/build/policy/variables_spec.rb
spec/lib/gitlab/ci/build/policy/variables_spec.rb
+1
-1
spec/lib/gitlab/ci/config/external/file/local_spec.rb
spec/lib/gitlab/ci/config/external/file/local_spec.rb
+2
-4
spec/lib/gitlab/ci/config/external/file/project_spec.rb
spec/lib/gitlab/ci/config/external/file/project_spec.rb
+3
-4
spec/lib/gitlab/ci/config/external/file/template_spec.rb
spec/lib/gitlab/ci/config/external/file/template_spec.rb
+2
-4
spec/lib/gitlab/ci/config/external/mapper_spec.rb
spec/lib/gitlab/ci/config/external/mapper_spec.rb
+2
-3
spec/lib/gitlab/ci/config/external/processor_spec.rb
spec/lib/gitlab/ci/config/external/processor_spec.rb
+3
-4
spec/lib/gitlab/ci/config_spec.rb
spec/lib/gitlab/ci/config_spec.rb
+1
-1
spec/lib/gitlab/ci/pipeline/chain/build_spec.rb
spec/lib/gitlab/ci/pipeline/chain/build_spec.rb
+2
-2
spec/lib/gitlab/ci/pipeline/chain/command_spec.rb
spec/lib/gitlab/ci/pipeline/chain/command_spec.rb
+1
-1
spec/lib/gitlab/ci/pipeline/chain/create_spec.rb
spec/lib/gitlab/ci/pipeline/chain/create_spec.rb
+2
-2
spec/lib/gitlab/ci/pipeline/chain/populate_spec.rb
spec/lib/gitlab/ci/pipeline/chain/populate_spec.rb
+2
-2
spec/lib/gitlab/ci/pipeline/chain/sequence_spec.rb
spec/lib/gitlab/ci/pipeline/chain/sequence_spec.rb
+2
-3
spec/lib/gitlab/ci/pipeline/chain/skip_spec.rb
spec/lib/gitlab/ci/pipeline/chain/skip_spec.rb
+3
-3
spec/lib/gitlab/ci/pipeline/chain/validate/abilities_spec.rb
spec/lib/gitlab/ci/pipeline/chain/validate/abilities_spec.rb
+2
-2
spec/lib/gitlab/ci/pipeline/chain/validate/repository_spec.rb
.../lib/gitlab/ci/pipeline/chain/validate/repository_spec.rb
+2
-3
spec/lib/gitlab/ci/status/composite_spec.rb
spec/lib/gitlab/ci/status/composite_spec.rb
+1
-1
spec/lib/gitlab/ci/trace/chunked_io_spec.rb
spec/lib/gitlab/ci/trace/chunked_io_spec.rb
+1
-1
spec/lib/gitlab/ci/trace/stream_spec.rb
spec/lib/gitlab/ci/trace/stream_spec.rb
+1
-1
spec/lib/gitlab/data_builder/wiki_page_spec.rb
spec/lib/gitlab/data_builder/wiki_page_spec.rb
+1
-1
spec/lib/gitlab/git/lfs_changes_spec.rb
spec/lib/gitlab/git/lfs_changes_spec.rb
+1
-1
spec/lib/gitlab/git/merge_base_spec.rb
spec/lib/gitlab/git/merge_base_spec.rb
+1
-1
spec/lib/gitlab/git/push_spec.rb
spec/lib/gitlab/git/push_spec.rb
+1
-2
spec/lib/gitlab/git_post_receive_spec.rb
spec/lib/gitlab/git_post_receive_spec.rb
+1
-1
spec/lib/gitlab/gitaly_client/operation_service_spec.rb
spec/lib/gitlab/gitaly_client/operation_service_spec.rb
+2
-2
spec/lib/gitlab/global_id_spec.rb
spec/lib/gitlab/global_id_spec.rb
+1
-1
spec/lib/gitlab/graphql/loaders/batch_lfs_oid_loader_spec.rb
spec/lib/gitlab/graphql/loaders/batch_lfs_oid_loader_spec.rb
+1
-1
spec/lib/gitlab/hashed_storage/migrator_spec.rb
spec/lib/gitlab/hashed_storage/migrator_spec.rb
+2
-2
spec/lib/gitlab/hook_data/issuable_builder_spec.rb
spec/lib/gitlab/hook_data/issuable_builder_spec.rb
+1
-1
spec/lib/gitlab/hook_data/issue_builder_spec.rb
spec/lib/gitlab/hook_data/issue_builder_spec.rb
+2
-2
spec/lib/gitlab/hook_data/merge_request_builder_spec.rb
spec/lib/gitlab/hook_data/merge_request_builder_spec.rb
+1
-1
spec/lib/gitlab/import/merge_request_helpers_spec.rb
spec/lib/gitlab/import/merge_request_helpers_spec.rb
+2
-2
spec/lib/gitlab/import_export/repo_saver_spec.rb
spec/lib/gitlab/import_export/repo_saver_spec.rb
+1
-1
spec/lib/gitlab/import_export/wiki_repo_saver_spec.rb
spec/lib/gitlab/import_export/wiki_repo_saver_spec.rb
+2
-2
spec/lib/gitlab/json_cache_spec.rb
spec/lib/gitlab/json_cache_spec.rb
+1
-2
spec/lib/gitlab/language_detection_spec.rb
spec/lib/gitlab/language_detection_spec.rb
+3
-3
spec/lib/gitlab/metrics/dashboard/finder_spec.rb
spec/lib/gitlab/metrics/dashboard/finder_spec.rb
+3
-3
spec/lib/gitlab/phabricator_import/cache/map_spec.rb
spec/lib/gitlab/phabricator_import/cache/map_spec.rb
+1
-1
spec/lib/gitlab/phabricator_import/issues/task_importer_spec.rb
...ib/gitlab/phabricator_import/issues/task_importer_spec.rb
+1
-1
spec/lib/gitlab/project_template_spec.rb
spec/lib/gitlab/project_template_spec.rb
+1
-1
spec/lib/gitlab/repo_path_spec.rb
spec/lib/gitlab/repo_path_spec.rb
+1
-1
spec/lib/gitlab/sanitizers/exif_spec.rb
spec/lib/gitlab/sanitizers/exif_spec.rb
+3
-3
spec/lib/gitlab/shell_spec.rb
spec/lib/gitlab/shell_spec.rb
+1
-2
spec/lib/gitlab/slash_commands/issue_move_spec.rb
spec/lib/gitlab/slash_commands/issue_move_spec.rb
+5
-5
spec/lib/gitlab/slash_commands/presenters/issue_move_spec.rb
spec/lib/gitlab/slash_commands/presenters/issue_move_spec.rb
+5
-5
spec/lib/gitlab/template/finders/repo_template_finders_spec.rb
...lib/gitlab/template/finders/repo_template_finders_spec.rb
+1
-2
spec/lib/gitlab/workhorse_spec.rb
spec/lib/gitlab/workhorse_spec.rb
+1
-1
No files found.
spec/lib/banzai/filter/inline_metrics_redactor_filter_spec.rb
View file @
78ab2fc3
...
...
@@ -5,8 +5,7 @@ require 'spec_helper'
describe
Banzai
::
Filter
::
InlineMetricsRedactorFilter
do
include
FilterSpecHelper
set
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let
(
:url
)
{
urls
.
metrics_dashboard_project_environment_url
(
project
,
1
,
embedded:
true
)
}
let
(
:input
)
{
%(<a href="#{url}">example</a>)
}
let
(
:doc
)
{
filter
(
input
)
}
...
...
spec/lib/banzai/pipeline/gfm_pipeline_spec.rb
View file @
78ab2fc3
...
...
@@ -121,7 +121,7 @@ describe Banzai::Pipeline::GfmPipeline do
end
describe
'emoji in references'
do
set
(
:project
)
{
create
(
:project
,
:public
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:emoji
)
{
'💯'
}
it
'renders a label reference with emoji inside'
do
...
...
spec/lib/event_filter_spec.rb
View file @
78ab2fc3
...
...
@@ -18,17 +18,16 @@ describe EventFilter do
end
describe
'#apply_filter'
do
set
(
:public_project
)
{
create
(
:project
,
:public
)
}
set
(
:push_event
)
{
create
(
:push_event
,
project:
public_project
)
}
set
(
:merged_event
)
{
create
(
:event
,
:merged
,
project:
public_project
,
target:
public_project
)
}
set
(
:created_event
)
{
create
(
:event
,
:created
,
project:
public_project
,
target:
create
(
:issue
,
project:
public_project
))
}
set
(
:updated_event
)
{
create
(
:event
,
:updated
,
project:
public_project
,
target:
create
(
:issue
,
project:
public_project
))
}
set
(
:closed_event
)
{
create
(
:event
,
:closed
,
project:
public_project
,
target:
create
(
:issue
,
project:
public_project
))
}
set
(
:reopened_event
)
{
create
(
:event
,
:reopened
,
project:
public_project
,
target:
create
(
:issue
,
project:
public_project
))
}
set
(
:comments_event
)
{
create
(
:event
,
:commented
,
project:
public_project
,
target:
public_project
)
}
set
(
:joined_event
)
{
create
(
:event
,
:joined
,
project:
public_project
,
target:
public_project
)
}
set
(
:left_event
)
{
create
(
:event
,
:left
,
project:
public_project
,
target:
public_project
)
}
let_it_be
(
:public_project
)
{
create
(
:project
,
:public
)
}
let_it_be
(
:push_event
)
{
create
(
:push_event
,
project:
public_project
)
}
let_it_be
(
:merged_event
)
{
create
(
:event
,
:merged
,
project:
public_project
,
target:
public_project
)
}
let_it_be
(
:created_event
)
{
create
(
:event
,
:created
,
project:
public_project
,
target:
create
(
:issue
,
project:
public_project
))
}
let_it_be
(
:updated_event
)
{
create
(
:event
,
:updated
,
project:
public_project
,
target:
create
(
:issue
,
project:
public_project
))
}
let_it_be
(
:closed_event
)
{
create
(
:event
,
:closed
,
project:
public_project
,
target:
create
(
:issue
,
project:
public_project
))
}
let_it_be
(
:reopened_event
)
{
create
(
:event
,
:reopened
,
project:
public_project
,
target:
create
(
:issue
,
project:
public_project
))
}
let_it_be
(
:comments_event
)
{
create
(
:event
,
:commented
,
project:
public_project
,
target:
public_project
)
}
let_it_be
(
:joined_event
)
{
create
(
:event
,
:joined
,
project:
public_project
,
target:
public_project
)
}
let_it_be
(
:left_event
)
{
create
(
:event
,
:left
,
project:
public_project
,
target:
public_project
)
}
let
(
:filtered_events
)
{
described_class
.
new
(
filter
).
apply_filter
(
Event
.
all
)
}
...
...
spec/lib/gitlab/auth_spec.rb
View file @
78ab2fc3
...
...
@@ -3,10 +3,9 @@
require
'spec_helper'
describe
Gitlab
::
Auth
,
:use_clean_rails_memory_store_caching
do
let_it_be
(
:project
)
{
create
(
:project
)
}
let
(
:gl_auth
)
{
described_class
}
set
(
:project
)
{
create
(
:project
)
}
describe
'constants'
do
it
'API_SCOPES contains all scopes for API access'
do
expect
(
subject
::
API_SCOPES
).
to
eq
%i[api read_user]
...
...
spec/lib/gitlab/checks/force_push_spec.rb
View file @
78ab2fc3
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
describe
Gitlab
::
Checks
::
ForcePush
do
set
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
describe
'.force_push?'
do
it
'returns false if the repo is empty'
do
...
...
spec/lib/gitlab/ci/build/policy/changes_spec.rb
View file @
78ab2fc3
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
describe
Gitlab
::
Ci
::
Build
::
Policy
::
Changes
do
set
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
describe
'#satisfied_by?'
do
describe
'paths matching'
do
...
...
@@ -89,7 +89,7 @@ describe Gitlab::Ci::Build::Policy::Changes do
end
describe
'gitaly integration'
do
set
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:pipeline
)
do
create
(
:ci_empty_pipeline
,
project:
project
,
...
...
@@ -119,6 +119,7 @@ describe Gitlab::Ci::Build::Policy::Changes do
end
context
'when branch is created'
do
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:pipeline
)
do
create
(
:ci_empty_pipeline
,
project:
project
,
ref:
'feature'
,
...
...
spec/lib/gitlab/ci/build/policy/kubernetes_spec.rb
View file @
78ab2fc3
...
...
@@ -18,7 +18,7 @@ describe Gitlab::Ci::Build::Policy::Kubernetes do
end
context
'when kubernetes service is inactive'
do
set
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
it
'is not satisfied by a pipeline without kubernetes available'
do
expect
(
described_class
.
new
(
'active'
))
...
...
spec/lib/gitlab/ci/build/policy/variables_spec.rb
View file @
78ab2fc3
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
describe
Gitlab
::
Ci
::
Build
::
Policy
::
Variables
do
set
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let
(
:pipeline
)
do
build
(
:ci_empty_pipeline
,
project:
project
,
ref:
'master'
,
source: :push
)
...
...
spec/lib/gitlab/ci/config/external/file/local_spec.rb
View file @
78ab2fc3
...
...
@@ -3,13 +3,11 @@
require
'spec_helper'
describe
Gitlab
::
Ci
::
Config
::
External
::
File
::
Local
do
set
(
:project
)
{
create
(
:project
,
:repository
)
}
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let
(
:sha
)
{
'12345'
}
let
(
:context_params
)
{
{
project:
project
,
sha:
sha
,
user:
user
}
}
let
(
:context
)
{
Gitlab
::
Ci
::
Config
::
External
::
Context
.
new
(
**
context_params
)
}
let
(
:params
)
{
{
local:
location
}
}
let
(
:local_file
)
{
described_class
.
new
(
params
,
context
)
}
...
...
spec/lib/gitlab/ci/config/external/file/project_spec.rb
View file @
78ab2fc3
...
...
@@ -3,10 +3,9 @@
require
'spec_helper'
describe
Gitlab
::
Ci
::
Config
::
External
::
File
::
Project
do
set
(
:context_project
)
{
create
(
:project
)
}
set
(
:project
)
{
create
(
:project
,
:repository
)
}
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:context_project
)
{
create
(
:project
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let
(
:context_user
)
{
user
}
let
(
:context_params
)
{
{
project:
context_project
,
sha:
'12345'
,
user:
context_user
}
}
let
(
:context
)
{
Gitlab
::
Ci
::
Config
::
External
::
Context
.
new
(
**
context_params
)
}
...
...
spec/lib/gitlab/ci/config/external/file/template_spec.rb
View file @
78ab2fc3
...
...
@@ -3,14 +3,12 @@
require
'spec_helper'
describe
Gitlab
::
Ci
::
Config
::
External
::
File
::
Template
do
set
(
:project
)
{
create
(
:project
)
}
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let
(
:context_params
)
{
{
project:
project
,
sha:
'12345'
,
user:
user
}
}
let
(
:context
)
{
Gitlab
::
Ci
::
Config
::
External
::
Context
.
new
(
**
context_params
)
}
let
(
:template
)
{
'Auto-DevOps.gitlab-ci.yml'
}
let
(
:params
)
{
{
template:
template
}
}
let
(
:template_file
)
{
described_class
.
new
(
params
,
context
)
}
before
do
...
...
spec/lib/gitlab/ci/config/external/mapper_spec.rb
View file @
78ab2fc3
...
...
@@ -5,9 +5,8 @@ require 'spec_helper'
describe
Gitlab
::
Ci
::
Config
::
External
::
Mapper
do
include
StubRequests
set
(
:project
)
{
create
(
:project
,
:repository
)
}
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let
(
:local_file
)
{
'/lib/gitlab/ci/templates/non-existent-file.yml'
}
let
(
:remote_url
)
{
'https://gitlab.com/gitlab-org/gitlab-foss/blob/1234/.gitlab-ci-1.yml'
}
let
(
:template_file
)
{
'Auto-DevOps.gitlab-ci.yml'
}
...
...
spec/lib/gitlab/ci/config/external/processor_spec.rb
View file @
78ab2fc3
...
...
@@ -5,10 +5,9 @@ require 'spec_helper'
describe
Gitlab
::
Ci
::
Config
::
External
::
Processor
do
include
StubRequests
set
(
:project
)
{
create
(
:project
,
:repository
)
}
set
(
:another_project
)
{
create
(
:project
,
:repository
)
}
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:another_project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let
(
:sha
)
{
'12345'
}
let
(
:context_params
)
{
{
project:
project
,
sha:
sha
,
user:
user
}
}
let
(
:context
)
{
Gitlab
::
Ci
::
Config
::
External
::
Context
.
new
(
**
context_params
)
}
...
...
spec/lib/gitlab/ci/config_spec.rb
View file @
78ab2fc3
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
describe
Gitlab
::
Ci
::
Config
do
include
StubRequests
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
before
do
allow_next_instance_of
(
Gitlab
::
Ci
::
Config
::
External
::
Context
)
do
|
instance
|
...
...
spec/lib/gitlab/ci/pipeline/chain/build_spec.rb
View file @
78ab2fc3
...
...
@@ -3,8 +3,8 @@
require
'spec_helper'
describe
Gitlab
::
Ci
::
Pipeline
::
Chain
::
Build
do
set
(
:project
)
{
create
(
:project
,
:repository
)
}
set
(
:user
)
{
create
(
:user
,
developer_projects:
[
project
])
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:user
)
{
create
(
:user
,
developer_projects:
[
project
])
}
let
(
:pipeline
)
{
Ci
::
Pipeline
.
new
}
let
(
:variables_attributes
)
do
...
...
spec/lib/gitlab/ci/pipeline/chain/command_spec.rb
View file @
78ab2fc3
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
describe
Gitlab
::
Ci
::
Pipeline
::
Chain
::
Command
do
set
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
describe
'#initialize'
do
subject
do
...
...
spec/lib/gitlab/ci/pipeline/chain/create_spec.rb
View file @
78ab2fc3
...
...
@@ -3,8 +3,8 @@
require
'spec_helper'
describe
Gitlab
::
Ci
::
Pipeline
::
Chain
::
Create
do
set
(
:project
)
{
create
(
:project
)
}
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let
(
:pipeline
)
do
build
(
:ci_empty_pipeline
,
project:
project
,
ref:
'master'
)
...
...
spec/lib/gitlab/ci/pipeline/chain/populate_spec.rb
View file @
78ab2fc3
...
...
@@ -3,8 +3,8 @@
require
'spec_helper'
describe
Gitlab
::
Ci
::
Pipeline
::
Chain
::
Populate
do
set
(
:project
)
{
create
(
:project
,
:repository
)
}
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let
(
:pipeline
)
do
build
(
:ci_pipeline
,
project:
project
,
ref:
'master'
,
user:
user
)
...
...
spec/lib/gitlab/ci/pipeline/chain/sequence_spec.rb
View file @
78ab2fc3
...
...
@@ -3,9 +3,8 @@
require
'spec_helper'
describe
Gitlab
::
Ci
::
Pipeline
::
Chain
::
Sequence
do
set
(
:project
)
{
create
(
:project
)
}
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let
(
:pipeline
)
{
build_stubbed
(
:ci_pipeline
)
}
let
(
:command
)
{
Gitlab
::
Ci
::
Pipeline
::
Chain
::
Command
.
new
}
let
(
:first_step
)
{
spy
(
'first step'
)
}
...
...
spec/lib/gitlab/ci/pipeline/chain/skip_spec.rb
View file @
78ab2fc3
...
...
@@ -3,9 +3,9 @@
require
'spec_helper'
describe
Gitlab
::
Ci
::
Pipeline
::
Chain
::
Skip
do
set
(
:project
)
{
create
(
:project
)
}
set
(
:user
)
{
create
(
:user
)
}
set
(
:pipelin
e
)
{
create
(
:ci_pipeline
,
project:
project
)
}
let_it_be
(
:project
,
reload:
true
)
{
create
(
:project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:pipeline
,
reload:
tru
e
)
{
create
(
:ci_pipeline
,
project:
project
)
}
let
(
:command
)
do
Gitlab
::
Ci
::
Pipeline
::
Chain
::
Command
.
new
(
...
...
spec/lib/gitlab/ci/pipeline/chain/validate/abilities_spec.rb
View file @
78ab2fc3
...
...
@@ -3,8 +3,8 @@
require
'spec_helper'
describe
Gitlab
::
Ci
::
Pipeline
::
Chain
::
Validate
::
Abilities
do
set
(
:project
)
{
create
(
:project
,
:repository
)
}
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
,
reload:
true
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let
(
:pipeline
)
do
build_stubbed
(
:ci_pipeline
,
project:
project
)
...
...
spec/lib/gitlab/ci/pipeline/chain/validate/repository_spec.rb
View file @
78ab2fc3
...
...
@@ -3,10 +3,9 @@
require
'spec_helper'
describe
Gitlab
::
Ci
::
Pipeline
::
Chain
::
Validate
::
Repository
do
set
(
:project
)
{
create
(
:project
,
:repository
)
}
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let
(
:pipeline
)
{
build_stubbed
(
:ci_pipeline
)
}
let!
(
:step
)
{
described_class
.
new
(
pipeline
,
command
)
}
before
do
...
...
spec/lib/gitlab/ci/status/composite_spec.rb
View file @
78ab2fc3
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
describe
Gitlab
::
Ci
::
Status
::
Composite
do
set
(
:pipeline
)
{
create
(
:ci_pipeline
)
}
let_it_be
(
:pipeline
)
{
create
(
:ci_pipeline
)
}
before
(
:all
)
do
@statuses
=
HasStatus
::
STATUSES_ENUM
.
map
do
|
status
,
idx
|
...
...
spec/lib/gitlab/ci/trace/chunked_io_spec.rb
View file @
78ab2fc3
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
describe
Gitlab
::
Ci
::
Trace
::
ChunkedIO
,
:clean_gitlab_redis_cache
do
include
ChunkedIOHelpers
set
(
:build
)
{
create
(
:ci_build
,
:running
)
}
let_it_be
(
:build
)
{
create
(
:ci_build
,
:running
)
}
let
(
:chunked_io
)
{
described_class
.
new
(
build
)
}
before
do
...
...
spec/lib/gitlab/ci/trace/stream_spec.rb
View file @
78ab2fc3
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
describe
Gitlab
::
Ci
::
Trace
::
Stream
,
:clean_gitlab_redis_cache
do
set
(
:build
)
{
create
(
:ci_build
,
:running
)
}
let_it_be
(
:build
)
{
create
(
:ci_build
,
:running
)
}
before
do
stub_feature_flags
(
ci_enable_live_trace:
true
)
...
...
spec/lib/gitlab/data_builder/wiki_page_spec.rb
View file @
78ab2fc3
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
describe
Gitlab
::
DataBuilder
::
WikiPage
do
set
(
:project
)
{
create
(
:project
,
:repository
,
:wiki_repo
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
,
:wiki_repo
)
}
let
(
:wiki_page
)
{
create
(
:wiki_page
,
wiki:
project
.
wiki
)
}
let
(
:user
)
{
create
(
:user
)
}
...
...
spec/lib/gitlab/git/lfs_changes_spec.rb
View file @
78ab2fc3
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
describe
Gitlab
::
Git
::
LfsChanges
do
set
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:newrev
)
{
'54fcc214b94e78d7a41a9a8fe6d87a5e59500e51'
}
let
(
:blob_object_id
)
{
'0c304a93cb8430108629bbbcaa27db3343299bc0'
}
...
...
spec/lib/gitlab/git/merge_base_spec.rb
View file @
78ab2fc3
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
describe
Gitlab
::
Git
::
MergeBase
do
set
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:repository
)
{
project
.
repository
}
subject
(
:merge_base
)
{
described_class
.
new
(
repository
,
refs
)
}
...
...
spec/lib/gitlab/git/push_spec.rb
View file @
78ab2fc3
...
...
@@ -3,8 +3,7 @@
require
'spec_helper'
describe
Gitlab
::
Git
::
Push
do
set
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:oldrev
)
{
project
.
commit
(
'HEAD~2'
).
id
}
let
(
:newrev
)
{
project
.
commit
.
id
}
let
(
:ref
)
{
'refs/heads/some-branch'
}
...
...
spec/lib/gitlab/git_post_receive_spec.rb
View file @
78ab2fc3
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
describe
::
Gitlab
::
GitPostReceive
do
set
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
subject
{
described_class
.
new
(
project
,
"project-
#{
project
.
id
}
"
,
changes
.
dup
,
{})
}
...
...
spec/lib/gitlab/gitaly_client/operation_service_spec.rb
View file @
78ab2fc3
...
...
@@ -3,10 +3,10 @@
require
'spec_helper'
describe
Gitlab
::
GitalyClient
::
OperationService
do
set
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:repository
)
{
project
.
repository
.
raw
}
let
(
:client
)
{
described_class
.
new
(
repository
)
}
set
(
:user
)
{
create
(
:user
)
}
let
(
:gitaly_user
)
{
Gitlab
::
Git
::
User
.
from_gitlab
(
user
).
to_gitaly
}
describe
'#user_create_branch'
do
...
...
spec/lib/gitlab/global_id_spec.rb
View file @
78ab2fc3
...
...
@@ -4,7 +4,7 @@ require 'spec_helper'
describe
Gitlab
::
GlobalId
do
describe
'.build'
do
set
(
:object
)
{
create
(
:issue
)
}
let_it_be
(
:object
)
{
create
(
:issue
)
}
it
'returns a standard GlobalId if only object is passed'
do
expect
(
described_class
.
build
(
object
).
to_s
).
to
eq
(
object
.
to_global_id
.
to_s
)
...
...
spec/lib/gitlab/graphql/loaders/batch_lfs_oid_loader_spec.rb
View file @
78ab2fc3
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
describe
Gitlab
::
Graphql
::
Loaders
::
BatchLfsOidLoader
do
include
GraphqlHelpers
set
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:repository
)
{
project
.
repository
}
let
(
:blob
)
{
Gitlab
::
Graphql
::
Representation
::
TreeEntry
.
new
(
repository
.
blob_at
(
'master'
,
'files/lfs/lfs_object.iso'
),
repository
)
}
let
(
:otherblob
)
{
Gitlab
::
Graphql
::
Representation
::
TreeEntry
.
new
(
repository
.
blob_at
(
'master'
,
'README'
),
repository
)
}
...
...
spec/lib/gitlab/hashed_storage/migrator_spec.rb
View file @
78ab2fc3
...
...
@@ -186,7 +186,7 @@ describe Gitlab::HashedStorage::Migrator, :redis do
end
describe
'migration_pending?'
do
set
(
:project
)
{
create
(
:project
,
:empty_repo
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:empty_repo
)
}
it
'returns true when there are MigratorWorker jobs scheduled'
do
Sidekiq
::
Testing
.
disable!
do
...
...
@@ -210,7 +210,7 @@ describe Gitlab::HashedStorage::Migrator, :redis do
end
describe
'rollback_pending?'
do
set
(
:project
)
{
create
(
:project
,
:empty_repo
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:empty_repo
)
}
it
'returns true when there are RollbackerWorker jobs scheduled'
do
Sidekiq
::
Testing
.
disable!
do
...
...
spec/lib/gitlab/hook_data/issuable_builder_spec.rb
View file @
78ab2fc3
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
describe
Gitlab
::
HookData
::
IssuableBuilder
do
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
# This shared example requires a `builder` and `user` variable
shared_examples
'issuable hook data'
do
|
kind
|
...
...
spec/lib/gitlab/hook_data/issue_builder_spec.rb
View file @
78ab2fc3
...
...
@@ -3,8 +3,8 @@
require
'spec_helper'
describe
Gitlab
::
HookData
::
IssueBuilder
do
set
(
:label
)
{
create
(
:label
)
}
set
(
:issue
)
{
create
(
:labeled_issue
,
labels:
[
label
],
project:
label
.
project
)
}
let_it_be
(
:label
)
{
create
(
:label
)
}
let_it_be
(
:issue
)
{
create
(
:labeled_issue
,
labels:
[
label
],
project:
label
.
project
)
}
let
(
:builder
)
{
described_class
.
new
(
issue
)
}
describe
'#build'
do
...
...
spec/lib/gitlab/hook_data/merge_request_builder_spec.rb
View file @
78ab2fc3
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
describe
Gitlab
::
HookData
::
MergeRequestBuilder
do
set
(
:merge_request
)
{
create
(
:merge_request
)
}
let_it_be
(
:merge_request
)
{
create
(
:merge_request
)
}
let
(
:builder
)
{
described_class
.
new
(
merge_request
)
}
describe
'#build'
do
...
...
spec/lib/gitlab/import/merge_request_helpers_spec.rb
View file @
78ab2fc3
...
...
@@ -3,8 +3,8 @@
require
'spec_helper'
describe
Gitlab
::
Import
::
MergeRequestHelpers
,
type: :helper
do
set
(
:project
)
{
create
(
:project
,
:repository
)
}
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
describe
'.create_merge_request_without_hooks'
do
let
(
:iid
)
{
42
}
...
...
spec/lib/gitlab/import_export/repo_saver_spec.rb
View file @
78ab2fc3
...
...
@@ -4,7 +4,7 @@ require 'spec_helper'
describe
Gitlab
::
ImportExport
::
RepoSaver
do
describe
'bundle a project Git repo'
do
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let!
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:export_path
)
{
"
#{
Dir
.
tmpdir
}
/project_tree_saver_spec"
}
let
(
:shared
)
{
project
.
import_export_shared
}
...
...
spec/lib/gitlab/import_export/wiki_repo_saver_spec.rb
View file @
78ab2fc3
...
...
@@ -4,8 +4,8 @@ require 'spec_helper'
describe
Gitlab
::
ImportExport
::
WikiRepoSaver
do
describe
'bundle a wiki Git repo'
do
set
(
:user
)
{
create
(
:user
)
}
let
!
(
:project
)
{
create
(
:project
,
:wiki_repo
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let
_it_be
(
:project
)
{
create
(
:project
,
:wiki_repo
)
}
let
(
:export_path
)
{
"
#{
Dir
.
tmpdir
}
/project_tree_saver_spec"
}
let
(
:shared
)
{
project
.
import_export_shared
}
let
(
:wiki_bundler
)
{
described_class
.
new
(
project:
project
,
shared:
shared
)
}
...
...
spec/lib/gitlab/json_cache_spec.rb
View file @
78ab2fc3
...
...
@@ -3,13 +3,12 @@
require
'spec_helper'
describe
Gitlab
::
JsonCache
do
let_it_be
(
:broadcast_message
)
{
create
(
:broadcast_message
)
}
let
(
:backend
)
{
double
(
'backend'
).
as_null_object
}
let
(
:namespace
)
{
'geo'
}
let
(
:key
)
{
'foo'
}
let
(
:expanded_key
)
{
"
#{
namespace
}
:
#{
key
}
:
#{
Gitlab
::
VERSION
}
:
#{
Rails
.
version
}
"
}
set
(
:broadcast_message
)
{
create
(
:broadcast_message
)
}
subject
(
:cache
)
{
described_class
.
new
(
namespace:
namespace
,
backend:
backend
)
}
describe
'#active?'
do
...
...
spec/lib/gitlab/language_detection_spec.rb
View file @
78ab2fc3
...
...
@@ -3,9 +3,9 @@
require
'spec_helper'
describe
Gitlab
::
LanguageDetection
do
set
(
:project
)
{
create
(
:project
,
:repository
)
}
set
(
:ruby
)
{
create
(
:programming_language
,
name:
'Ruby'
)
}
set
(
:haskell
)
{
create
(
:programming_language
,
name:
'Haskell'
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:ruby
)
{
create
(
:programming_language
,
name:
'Ruby'
)
}
let_it_be
(
:haskell
)
{
create
(
:programming_language
,
name:
'Haskell'
)
}
let
(
:repository
)
{
project
.
repository
}
let
(
:detection
)
do
[{
value:
66.63
,
label:
"Ruby"
,
color:
"#701516"
,
highlight:
"#701516"
},
...
...
spec/lib/gitlab/metrics/dashboard/finder_spec.rb
View file @
78ab2fc3
...
...
@@ -5,9 +5,9 @@ require 'spec_helper'
describe
Gitlab
::
Metrics
::
Dashboard
::
Finder
,
:use_clean_rails_memory_store_caching
do
include
MetricsDashboardHelpers
set
(
:project
)
{
create
(
:project
)
}
set
(
:user
)
{
create
(
:user
)
}
set
(
:environment
)
{
create
(
:environment
,
project:
project
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:environment
)
{
create
(
:environment
,
project:
project
)
}
before
do
project
.
add_maintainer
(
user
)
...
...
spec/lib/gitlab/phabricator_import/cache/map_spec.rb
View file @
78ab2fc3
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
describe
Gitlab
::
PhabricatorImport
::
Cache
::
Map
,
:clean_gitlab_redis_cache
do
set
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let
(
:redis
)
{
Gitlab
::
Redis
::
Cache
}
subject
(
:map
)
{
described_class
.
new
(
project
)
}
...
...
spec/lib/gitlab/phabricator_import/issues/task_importer_spec.rb
View file @
78ab2fc3
...
...
@@ -2,7 +2,7 @@
require
'spec_helper'
describe
Gitlab
::
PhabricatorImport
::
Issues
::
TaskImporter
do
set
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let
(
:task
)
do
Gitlab
::
PhabricatorImport
::
Representation
::
Task
.
new
(
{
...
...
spec/lib/gitlab/project_template_spec.rb
View file @
78ab2fc3
...
...
@@ -73,7 +73,7 @@ describe Gitlab::ProjectTemplate do
end
describe
'validate all templates'
do
set
(
:admin
)
{
create
(
:admin
)
}
let_it_be
(
:admin
)
{
create
(
:admin
)
}
described_class
.
all
.
each
do
|
template
|
it
"
#{
template
.
name
}
has a valid archive"
do
...
...
spec/lib/gitlab/repo_path_spec.rb
View file @
78ab2fc3
...
...
@@ -4,7 +4,7 @@ require 'spec_helper'
describe
::
Gitlab
::
RepoPath
do
describe
'.parse'
do
set
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
context
'a repository storage path'
do
it
'parses a full repository path'
do
...
...
spec/lib/gitlab/sanitizers/exif_spec.rb
View file @
78ab2fc3
...
...
@@ -7,9 +7,9 @@ describe Gitlab::Sanitizers::Exif do
describe
'#batch_clean'
do
context
'with image uploads'
do
set
(
:upload1
)
{
create
(
:upload
,
:with_file
,
:issuable_upload
)
}
set
(
:upload2
)
{
create
(
:upload
,
:with_file
,
:personal_snippet_upload
)
}
set
(
:upload3
)
{
create
(
:upload
,
:with_file
,
created_at:
3
.
days
.
ago
)
}
let_it_be
(
:upload1
)
{
create
(
:upload
,
:with_file
,
:issuable_upload
)
}
let_it_be
(
:upload2
)
{
create
(
:upload
,
:with_file
,
:personal_snippet_upload
)
}
let_it_be
(
:upload3
)
{
create
(
:upload
,
:with_file
,
created_at:
3
.
days
.
ago
)
}
it
'processes all uploads if range ID is not set'
do
expect
(
sanitizer
).
to
receive
(
:clean
).
exactly
(
3
).
times
...
...
spec/lib/gitlab/shell_spec.rb
View file @
78ab2fc3
...
...
@@ -4,8 +4,7 @@ require 'spec_helper'
require
'stringio'
describe
Gitlab
::
Shell
do
set
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:repository
)
{
project
.
repository
}
let
(
:gitlab_shell
)
{
described_class
.
new
}
let
(
:popen_vars
)
{
{
'GIT_TERMINAL_PROMPT'
=>
ENV
[
'GIT_TERMINAL_PROMPT'
]
}
}
...
...
spec/lib/gitlab/slash_commands/issue_move_spec.rb
View file @
78ab2fc3
...
...
@@ -22,11 +22,11 @@ describe Gitlab::SlashCommands::IssueMove, service: true do
end
describe
'#execute'
do
set
(
:user
)
{
create
(
:user
)
}
set
(
:issue
)
{
create
(
:issue
)
}
set
(
:chat_name
)
{
create
(
:chat_name
,
user:
user
)
}
set
(
:project
)
{
issue
.
project
}
set
(
:other_project
)
{
create
(
:project
,
namespace:
project
.
namespace
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:issue
)
{
create
(
:issue
)
}
let_it_be
(
:chat_name
)
{
create
(
:chat_name
,
user:
user
)
}
let_it_be
(
:project
)
{
issue
.
project
}
let_it_be
(
:other_project
)
{
create
(
:project
,
namespace:
project
.
namespace
)
}
before
do
[
project
,
other_project
].
each
{
|
prj
|
prj
.
add_maintainer
(
user
)
}
...
...
spec/lib/gitlab/slash_commands/presenters/issue_move_spec.rb
View file @
78ab2fc3
...
...
@@ -3,11 +3,11 @@
require
'spec_helper'
describe
Gitlab
::
SlashCommands
::
Presenters
::
IssueMove
do
set
(
:admin
)
{
create
(
:admin
)
}
set
(
:project
)
{
create
(
:project
)
}
set
(
:other_project
)
{
create
(
:project
)
}
set
(
:old_iss
ue
)
{
create
(
:issue
,
project:
project
)
}
s
et
(
:new_issue
)
{
Issues
::
MoveService
.
new
(
project
,
admin
).
execute
(
old_issue
,
other_project
)
}
let_it_be
(
:admin
)
{
create
(
:admin
)
}
let_it_be
(
:project
,
reload:
true
)
{
create
(
:project
)
}
let_it_be
(
:other_project
)
{
create
(
:project
)
}
let_it_be
(
:old_issue
,
reload:
tr
ue
)
{
create
(
:issue
,
project:
project
)
}
l
et
(
:new_issue
)
{
Issues
::
MoveService
.
new
(
project
,
admin
).
execute
(
old_issue
,
other_project
)
}
let
(
:attachment
)
{
subject
[
:attachments
].
first
}
subject
{
described_class
.
new
(
new_issue
).
present
(
old_issue
)
}
...
...
spec/lib/gitlab/template/finders/repo_template_finders_spec.rb
View file @
78ab2fc3
...
...
@@ -3,8 +3,7 @@
require
'spec_helper'
describe
Gitlab
::
Template
::
Finders
::
RepoTemplateFinder
do
set
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:categories
)
{
{
'HTML'
=>
'html'
}
}
subject
(
:finder
)
{
described_class
.
new
(
project
,
'files/'
,
'.html'
,
categories
)
}
...
...
spec/lib/gitlab/workhorse_spec.rb
View file @
78ab2fc3
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
describe
Gitlab
::
Workhorse
do
set
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:repository
)
{
project
.
repository
}
def
decode_workhorse_header
(
array
)
...
...
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