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
ed0839d1
Commit
ed0839d1
authored
Oct 17, 2019
by
James Fargher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed and reenabled EmptyLineAfterSubject
Ran: bundle exec rubocop --only RSpec/EmptyLineAfterSubject -a
parent
30639b41
Changes
125
Show whitespace changes
Inline
Side-by-side
Showing
125 changed files
with
277 additions
and
5 deletions
+277
-5
.rubocop_todo.yml
.rubocop_todo.yml
+0
-5
ee/spec/controllers/analytics/productivity_analytics_controller_spec.rb
...llers/analytics/productivity_analytics_controller_spec.rb
+1
-0
ee/spec/controllers/projects/project_members_controller_spec.rb
...c/controllers/projects/project_members_controller_spec.rb
+2
-0
ee/spec/factories/smartcard_identities.rb
ee/spec/factories/smartcard_identities.rb
+1
-0
ee/spec/finders/ee/group_members_finder_spec.rb
ee/spec/finders/ee/group_members_finder_spec.rb
+1
-0
ee/spec/finders/productivity_analytics_finder_spec.rb
ee/spec/finders/productivity_analytics_finder_spec.rb
+1
-0
ee/spec/helpers/ee/user_callouts_helper_spec.rb
ee/spec/helpers/ee/user_callouts_helper_spec.rb
+2
-0
ee/spec/lib/analytics/productivity_calculator_spec.rb
ee/spec/lib/analytics/productivity_calculator_spec.rb
+1
-0
ee/spec/lib/ee/api/helpers_spec.rb
ee/spec/lib/ee/api/helpers_spec.rb
+1
-0
ee/spec/lib/gitlab/ci/reports/license_scanning/report_spec.rb
...pec/lib/gitlab/ci/reports/license_scanning/report_spec.rb
+2
-0
ee/spec/lib/gitlab/ci/reports/security/occurrence_spec.rb
ee/spec/lib/gitlab/ci/reports/security/occurrence_spec.rb
+1
-0
ee/spec/lib/omni_auth/strategies/kerberos_spnego_spec.rb
ee/spec/lib/omni_auth/strategies/kerberos_spnego_spec.rb
+1
-0
ee/spec/mailers/emails/csv_export_spec.rb
ee/spec/mailers/emails/csv_export_spec.rb
+1
-0
ee/spec/models/approvable_spec.rb
ee/spec/models/approvable_spec.rb
+1
-0
ee/spec/models/approval_merge_request_rule_spec.rb
ee/spec/models/approval_merge_request_rule_spec.rb
+1
-0
ee/spec/models/approval_project_rule_spec.rb
ee/spec/models/approval_project_rule_spec.rb
+1
-0
ee/spec/models/ci/build_spec.rb
ee/spec/models/ci/build_spec.rb
+1
-0
ee/spec/models/ci/pipeline_spec.rb
ee/spec/models/ci/pipeline_spec.rb
+1
-0
ee/spec/models/ee/resource_label_event_spec.rb
ee/spec/models/ee/resource_label_event_spec.rb
+1
-0
ee/spec/models/merge_request_spec.rb
ee/spec/models/merge_request_spec.rb
+5
-0
ee/spec/models/productivity_analytics_spec.rb
ee/spec/models/productivity_analytics_spec.rb
+1
-0
ee/spec/models/project_spec.rb
ee/spec/models/project_spec.rb
+2
-0
ee/spec/models/prometheus_alert_event_spec.rb
ee/spec/models/prometheus_alert_event_spec.rb
+1
-0
ee/spec/models/software_license_policy_spec.rb
ee/spec/models/software_license_policy_spec.rb
+1
-0
ee/spec/models/software_license_spec.rb
ee/spec/models/software_license_spec.rb
+1
-0
ee/spec/serializers/productivity_analytics_merge_request_entity_spec.rb
...izers/productivity_analytics_merge_request_entity_spec.rb
+1
-0
ee/spec/services/approval_rules/create_service_spec.rb
ee/spec/services/approval_rules/create_service_spec.rb
+1
-0
ee/spec/services/feature_flags/create_service_spec.rb
ee/spec/services/feature_flags/create_service_spec.rb
+1
-0
ee/spec/services/feature_flags/update_service_spec.rb
ee/spec/services/feature_flags/update_service_spec.rb
+1
-0
ee/spec/services/geo/project_housekeeping_service_spec.rb
ee/spec/services/geo/project_housekeeping_service_spec.rb
+1
-0
ee/spec/services/group_saml/group_managed_accounts/clean_up_members_service_spec.rb
...l/group_managed_accounts/clean_up_members_service_spec.rb
+1
-0
ee/spec/services/group_saml/saml_provider/update_service_spec.rb
.../services/group_saml/saml_provider/update_service_spec.rb
+1
-0
ee/spec/services/merge_requests/sync_report_approver_approval_rules_spec.rb
...erge_requests/sync_report_approver_approval_rules_spec.rb
+1
-0
ee/spec/workers/elastic_batch_project_indexer_worker_spec.rb
ee/spec/workers/elastic_batch_project_indexer_worker_spec.rb
+1
-0
qa/spec/page/element_spec.rb
qa/spec/page/element_spec.rb
+1
-0
spec/controllers/projects/issues_controller_spec.rb
spec/controllers/projects/issues_controller_spec.rb
+1
-0
spec/controllers/projects/notes_controller_spec.rb
spec/controllers/projects/notes_controller_spec.rb
+1
-0
spec/controllers/projects/settings/ci_cd_controller_spec.rb
spec/controllers/projects/settings/ci_cd_controller_spec.rb
+1
-0
spec/factories/gitaly/commit.rb
spec/factories/gitaly/commit.rb
+1
-0
spec/features/security/group/internal_access_spec.rb
spec/features/security/group/internal_access_spec.rb
+1
-0
spec/features/security/group/private_access_spec.rb
spec/features/security/group/private_access_spec.rb
+1
-0
spec/features/security/group/public_access_spec.rb
spec/features/security/group/public_access_spec.rb
+1
-0
spec/features/security/project/internal_access_spec.rb
spec/features/security/project/internal_access_spec.rb
+1
-0
spec/features/security/project/private_access_spec.rb
spec/features/security/project/private_access_spec.rb
+1
-0
spec/features/security/project/public_access_spec.rb
spec/features/security/project/public_access_spec.rb
+1
-0
spec/finders/clusters/knative_services_finder_spec.rb
spec/finders/clusters/knative_services_finder_spec.rb
+1
-0
spec/finders/concerns/finder_with_cross_project_access_spec.rb
...finders/concerns/finder_with_cross_project_access_spec.rb
+1
-0
spec/helpers/merge_requests_helper_spec.rb
spec/helpers/merge_requests_helper_spec.rb
+1
-0
spec/lib/backup/files_spec.rb
spec/lib/backup/files_spec.rb
+1
-0
spec/lib/banzai/filter/project_reference_filter_spec.rb
spec/lib/banzai/filter/project_reference_filter_spec.rb
+1
-0
spec/lib/banzai/filter/user_reference_filter_spec.rb
spec/lib/banzai/filter/user_reference_filter_spec.rb
+1
-0
spec/lib/banzai/reference_parser/commit_parser_spec.rb
spec/lib/banzai/reference_parser/commit_parser_spec.rb
+1
-0
spec/lib/banzai/reference_parser/commit_range_parser_spec.rb
spec/lib/banzai/reference_parser/commit_range_parser_spec.rb
+1
-0
spec/lib/banzai/reference_parser/external_issue_parser_spec.rb
...lib/banzai/reference_parser/external_issue_parser_spec.rb
+1
-0
spec/lib/banzai/reference_parser/label_parser_spec.rb
spec/lib/banzai/reference_parser/label_parser_spec.rb
+1
-0
spec/lib/banzai/reference_parser/merge_request_parser_spec.rb
.../lib/banzai/reference_parser/merge_request_parser_spec.rb
+1
-0
spec/lib/banzai/reference_parser/milestone_parser_spec.rb
spec/lib/banzai/reference_parser/milestone_parser_spec.rb
+1
-0
spec/lib/banzai/reference_parser/project_parser_spec.rb
spec/lib/banzai/reference_parser/project_parser_spec.rb
+1
-0
spec/lib/banzai/reference_parser/snippet_parser_spec.rb
spec/lib/banzai/reference_parser/snippet_parser_spec.rb
+1
-0
spec/lib/banzai/reference_parser/user_parser_spec.rb
spec/lib/banzai/reference_parser/user_parser_spec.rb
+1
-0
spec/lib/gitlab/ci/build/artifacts/metadata/entry_spec.rb
spec/lib/gitlab/ci/build/artifacts/metadata/entry_spec.rb
+15
-0
spec/lib/gitlab/ci/build/artifacts/metadata_spec.rb
spec/lib/gitlab/ci/build/artifacts/metadata_spec.rb
+4
-0
spec/lib/gitlab/ci/config/entry/cache_spec.rb
spec/lib/gitlab/ci/config/entry/cache_spec.rb
+1
-0
spec/lib/gitlab/ci/config/entry/coverage_spec.rb
spec/lib/gitlab/ci/config/entry/coverage_spec.rb
+7
-0
spec/lib/gitlab/cleanup/project_uploads_spec.rb
spec/lib/gitlab/cleanup/project_uploads_spec.rb
+1
-0
spec/lib/gitlab/danger/teammate_spec.rb
spec/lib/gitlab/danger/teammate_spec.rb
+1
-0
spec/lib/gitlab/downtime_check_spec.rb
spec/lib/gitlab/downtime_check_spec.rb
+1
-0
spec/lib/gitlab/email/message/repository_push_spec.rb
spec/lib/gitlab/email/message/repository_push_spec.rb
+18
-0
spec/lib/gitlab/experimentation_spec.rb
spec/lib/gitlab/experimentation_spec.rb
+1
-0
spec/lib/gitlab/gfm/uploads_rewriter_spec.rb
spec/lib/gitlab/gfm/uploads_rewriter_spec.rb
+2
-0
spec/lib/gitlab/git/branch_spec.rb
spec/lib/gitlab/git/branch_spec.rb
+1
-0
spec/lib/gitlab/git/commit_spec.rb
spec/lib/gitlab/git/commit_spec.rb
+9
-0
spec/lib/gitlab/git/diff_collection_spec.rb
spec/lib/gitlab/git/diff_collection_spec.rb
+51
-0
spec/lib/gitlab/git/repository_spec.rb
spec/lib/gitlab/git/repository_spec.rb
+3
-0
spec/lib/gitlab/gitlab_import/client_spec.rb
spec/lib/gitlab/gitlab_import/client_spec.rb
+3
-0
spec/lib/gitlab/graphs/commits_spec.rb
spec/lib/gitlab/graphs/commits_spec.rb
+3
-0
spec/lib/gitlab/health_checks/gitaly_check_spec.rb
spec/lib/gitlab/health_checks/gitaly_check_spec.rb
+1
-0
spec/lib/gitlab/health_checks/simple_check_shared.rb
spec/lib/gitlab/health_checks/simple_check_shared.rb
+2
-0
spec/lib/gitlab/metrics/samplers/puma_sampler_spec.rb
spec/lib/gitlab/metrics/samplers/puma_sampler_spec.rb
+1
-0
spec/lib/gitlab/phabricator_import/worker_state_spec.rb
spec/lib/gitlab/phabricator_import/worker_state_spec.rb
+1
-0
spec/lib/gitlab/reference_extractor_spec.rb
spec/lib/gitlab/reference_extractor_spec.rb
+1
-0
spec/lib/gitlab/request_context_spec.rb
spec/lib/gitlab/request_context_spec.rb
+1
-0
spec/lib/gitlab/shell_spec.rb
spec/lib/gitlab/shell_spec.rb
+1
-0
spec/lib/gitlab/sidekiq_middleware/memory_killer_spec.rb
spec/lib/gitlab/sidekiq_middleware/memory_killer_spec.rb
+1
-0
spec/lib/gitlab/utils/override_spec.rb
spec/lib/gitlab/utils/override_spec.rb
+6
-0
spec/lib/google_api/cloud_platform/client_spec.rb
spec/lib/google_api/cloud_platform/client_spec.rb
+2
-0
spec/lib/json_web_token/token_spec.rb
spec/lib/json_web_token/token_spec.rb
+1
-0
spec/lib/omni_auth/strategies/jwt_spec.rb
spec/lib/omni_auth/strategies/jwt_spec.rb
+1
-0
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+3
-0
spec/models/ci/runner_spec.rb
spec/models/ci/runner_spec.rb
+2
-0
spec/models/concerns/noteable_spec.rb
spec/models/concerns/noteable_spec.rb
+1
-0
spec/models/concerns/token_authenticatable_spec.rb
spec/models/concerns/token_authenticatable_spec.rb
+1
-0
spec/models/deploy_keys_project_spec.rb
spec/models/deploy_keys_project_spec.rb
+1
-0
spec/models/event_spec.rb
spec/models/event_spec.rb
+5
-0
spec/models/gpg_signature_spec.rb
spec/models/gpg_signature_spec.rb
+1
-0
spec/models/issue_spec.rb
spec/models/issue_spec.rb
+1
-0
spec/models/merge_request_spec.rb
spec/models/merge_request_spec.rb
+6
-0
spec/models/note_spec.rb
spec/models/note_spec.rb
+10
-0
spec/models/pages_domain_spec.rb
spec/models/pages_domain_spec.rb
+2
-0
spec/models/project_spec.rb
spec/models/project_spec.rb
+1
-0
spec/models/project_wiki_spec.rb
spec/models/project_wiki_spec.rb
+2
-0
spec/models/resource_label_event_spec.rb
spec/models/resource_label_event_spec.rb
+1
-0
spec/models/timelog_spec.rb
spec/models/timelog_spec.rb
+1
-0
spec/models/user_interacted_project_spec.rb
spec/models/user_interacted_project_spec.rb
+1
-0
spec/models/user_spec.rb
spec/models/user_spec.rb
+1
-0
spec/policies/identity_provider_policy_spec.rb
spec/policies/identity_provider_policy_spec.rb
+1
-0
spec/policies/merge_request_policy_spec.rb
spec/policies/merge_request_policy_spec.rb
+6
-0
spec/presenters/conversational_development_index/metric_presenter_spec.rb
...conversational_development_index/metric_presenter_spec.rb
+1
-0
spec/requests/api/graphql/namespace/projects_spec.rb
spec/requests/api/graphql/namespace/projects_spec.rb
+1
-0
spec/requests/api/pages/internal_access_spec.rb
spec/requests/api/pages/internal_access_spec.rb
+1
-0
spec/requests/api/pages/private_access_spec.rb
spec/requests/api/pages/private_access_spec.rb
+1
-0
spec/requests/api/pages/public_access_spec.rb
spec/requests/api/pages/public_access_spec.rb
+1
-0
spec/rubocop/cop/migration/add_timestamps_spec.rb
spec/rubocop/cop/migration/add_timestamps_spec.rb
+1
-0
spec/rubocop/cop/migration/timestamps_spec.rb
spec/rubocop/cop/migration/timestamps_spec.rb
+1
-0
spec/rubocop/cop/scalability/file_uploads_spec.rb
spec/rubocop/cop/scalability/file_uploads_spec.rb
+1
-0
spec/serializers/cluster_basic_entity_spec.rb
spec/serializers/cluster_basic_entity_spec.rb
+1
-0
spec/serializers/pipeline_serializer_spec.rb
spec/serializers/pipeline_serializer_spec.rb
+1
-0
spec/services/git/tag_hooks_service_spec.rb
spec/services/git/tag_hooks_service_spec.rb
+1
-0
spec/services/merge_requests/create_from_issue_service_spec.rb
...services/merge_requests/create_from_issue_service_spec.rb
+1
-0
spec/services/projects/housekeeping_service_spec.rb
spec/services/projects/housekeeping_service_spec.rb
+1
-0
spec/support/redis/redis_shared_examples.rb
spec/support/redis/redis_shared_examples.rb
+1
-0
spec/support/shared_examples/models/cluster_application_status_shared_examples.rb
...ples/models/cluster_application_status_shared_examples.rb
+1
-0
spec/tasks/gitlab/check_rake_spec.rb
spec/tasks/gitlab/check_rake_spec.rb
+6
-0
spec/workers/hashed_storage/migrator_worker_spec.rb
spec/workers/hashed_storage/migrator_worker_spec.rb
+1
-0
spec/workers/hashed_storage/rollbacker_worker_spec.rb
spec/workers/hashed_storage/rollbacker_worker_spec.rb
+1
-0
No files found.
.rubocop_todo.yml
View file @
ed0839d1
...
...
@@ -273,11 +273,6 @@ RSpec/ContextWording:
RSpec/EmptyLineAfterFinalLet
:
Enabled
:
false
# Offense count: 232
# Cop supports --auto-correct.
RSpec/EmptyLineAfterSubject
:
Enabled
:
false
# Offense count: 719
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
...
...
ee/spec/controllers/analytics/productivity_analytics_controller_spec.rb
View file @
ed0839d1
...
...
@@ -66,6 +66,7 @@ describe Analytics::ProductivityAnalyticsController do
describe
'GET show.json'
do
subject
{
get
:show
,
format: :json
,
params:
params
}
let
(
:params
)
{
{}
}
let
(
:analytics_mock
)
{
instance_double
(
'ProductivityAnalytics'
)
}
...
...
ee/spec/controllers/projects/project_members_controller_spec.rb
View file @
ed0839d1
...
...
@@ -15,6 +15,7 @@ describe Projects::ProjectMembersController do
source_project_id:
another_project
.
id
})
end
let
(
:another_project
)
{
create
(
:project
,
:private
)
}
let
(
:member
)
{
create
(
:user
)
}
...
...
@@ -53,6 +54,7 @@ describe Projects::ProjectMembersController do
project_id:
project
}
end
let
(
:access_level
)
{
nil
}
before
do
...
...
ee/spec/factories/smartcard_identities.rb
View file @
ed0839d1
...
...
@@ -3,6 +3,7 @@
FactoryBot
.
define
do
factory
:smartcard_identity
do
subject
{
'CN=gitlab-user/emailAddress=gitlab-user@random-corp.org'
}
issuer
{
'O=Random Corp Ltd, CN=Random Corp'
}
association
:user
...
...
ee/spec/finders/ee/group_members_finder_spec.rb
View file @
ed0839d1
...
...
@@ -4,6 +4,7 @@ require 'spec_helper'
describe
GroupMembersFinder
do
subject
(
:finder
)
{
described_class
.
new
(
group
)
}
let
(
:group
)
{
create
:group
}
let
(
:non_owner_access_level
)
{
Gitlab
::
Access
.
options
.
values
.
sample
}
...
...
ee/spec/finders/productivity_analytics_finder_spec.rb
View file @
ed0839d1
...
...
@@ -4,6 +4,7 @@ require 'spec_helper'
describe
ProductivityAnalyticsFinder
do
subject
{
described_class
.
new
(
current_user
,
search_params
.
merge
(
state: :merged
))
}
let
(
:current_user
)
{
create
(
:admin
)
}
let
(
:search_params
)
{
{}
}
...
...
ee/spec/helpers/ee/user_callouts_helper_spec.rb
View file @
ed0839d1
...
...
@@ -55,6 +55,7 @@ describe EE::UserCalloutsHelper do
describe
'.show_enable_hashed_storage_warning?'
do
subject
{
helper
.
show_enable_hashed_storage_warning?
}
let
(
:user
)
{
create
(
:user
)
}
context
'when hashed storage is disabled'
do
...
...
@@ -87,6 +88,7 @@ describe EE::UserCalloutsHelper do
describe
'.show_migrate_hashed_storage_warning?'
do
subject
{
helper
.
show_migrate_hashed_storage_warning?
}
let
(
:user
)
{
create
(
:user
)
}
context
'when hashed storage is disabled'
do
...
...
ee/spec/lib/analytics/productivity_calculator_spec.rb
View file @
ed0839d1
...
...
@@ -4,6 +4,7 @@ require 'spec_helper'
describe
Analytics
::
ProductivityCalculator
do
subject
{
described_class
.
new
(
merge_request
)
}
let
(
:merge_request
)
{
create
(
:merge_request_with_diff_notes
,
:merged
,
:with_diffs
,
created_at:
31
.
days
.
ago
)
}
describe
'#productivity_data'
do
...
...
ee/spec/lib/ee/api/helpers_spec.rb
View file @
ed0839d1
...
...
@@ -95,6 +95,7 @@ describe EE::API::Helpers do
describe
'#authorize_change_param'
do
subject
{
Class
.
new
.
include
(
described_class
).
new
}
let
(
:project
)
{
create
(
:project
)
}
before
do
...
...
ee/spec/lib/gitlab/ci/reports/license_scanning/report_spec.rb
View file @
ed0839d1
...
...
@@ -192,6 +192,7 @@ describe Gitlab::Ci::Reports::LicenseScanning::Report do
describe
'.parse_from'
do
context
'when parsing a v1 report'
do
subject
{
described_class
.
parse_from
(
v1_json
)
}
let
(
:v1_json
)
{
fixture_file
(
'security_reports/master/gl-license-management-report.json'
,
dir:
'ee'
)
}
it
{
expect
(
subject
.
version
).
to
eql
(
'1.0'
)
}
...
...
@@ -200,6 +201,7 @@ describe Gitlab::Ci::Reports::LicenseScanning::Report do
context
'when parsing a v2 report'
do
subject
{
described_class
.
parse_from
(
v2_json
)
}
let
(
:v2_json
)
{
fixture_file
(
'security_reports/gl-license-management-report-v2.json'
,
dir:
'ee'
)
}
it
{
expect
(
subject
.
version
).
to
eql
(
'2.0'
)
}
...
...
ee/spec/lib/gitlab/ci/reports/security/occurrence_spec.rb
View file @
ed0839d1
...
...
@@ -63,6 +63,7 @@ describe Gitlab::Ci::Reports::Security::Occurrence do
describe
"delegation"
do
subject
{
create
(
:ci_reports_security_occurrence
)
}
%i[file_path start_line end_line]
.
each
do
|
attribute
|
it
"delegates attribute
#{
attribute
}
to location"
do
expect
(
subject
.
public_send
(
attribute
)).
to
eq
(
subject
.
location
.
public_send
(
attribute
))
...
...
ee/spec/lib/omni_auth/strategies/kerberos_spnego_spec.rb
View file @
ed0839d1
...
...
@@ -4,6 +4,7 @@ require 'spec_helper'
describe
OmniAuth
::
Strategies
::
KerberosSpnego
do
subject
{
described_class
.
new
(
:app
)
}
let
(
:session
)
{
{}
}
before
do
...
...
ee/spec/mailers/emails/csv_export_spec.rb
View file @
ed0839d1
...
...
@@ -18,6 +18,7 @@ describe Emails::CsvExport do
let
(
:empty_project
)
{
create
(
:project
,
path:
'myproject'
)
}
let
(
:export_status
)
{
{
truncated:
false
,
rows_expected:
3
,
rows_written:
3
}
}
subject
{
Notify
.
issues_csv_email
(
user
,
empty_project
,
"dummy content"
,
export_status
)
}
let
(
:attachment
)
{
subject
.
attachments
.
first
}
it
'attachment has csv mime type'
do
...
...
ee/spec/models/approvable_spec.rb
View file @
ed0839d1
...
...
@@ -4,6 +4,7 @@ require 'spec_helper'
describe
Approvable
do
subject
(
:merge_request
)
{
create
(
:merge_request
)
}
let
(
:project
)
{
merge_request
.
project
}
let
(
:author
)
{
merge_request
.
author
}
...
...
ee/spec/models/approval_merge_request_rule_spec.rb
View file @
ed0839d1
...
...
@@ -309,6 +309,7 @@ describe ApprovalMergeRequestRule do
context
"when the rule is a `
#{
ApprovalRuleLike
::
DEFAULT_NAME_FOR_LICENSE_REPORT
}
` rule"
do
subject
{
create
(
:report_approver_rule
,
:requires_approval
,
:license_management
,
merge_request:
open_merge_request
)
}
let
(
:open_merge_request
)
{
create
(
:merge_request
,
:opened
,
target_project:
project
,
source_project:
project
)
}
let!
(
:project_approval_rule
)
{
create
(
:approval_project_rule
,
:requires_approval
,
:license_management
,
project:
project
)
}
let
(
:project
)
{
create
(
:project
)
}
...
...
ee/spec/models/approval_project_rule_spec.rb
View file @
ed0839d1
...
...
@@ -80,6 +80,7 @@ describe ApprovalProjectRule do
ApprovalProjectRule
::
REPORT_TYPES_BY_DEFAULT_NAME
.
each
do
|
name
,
value
|
context
"when the project rule is for a `
#{
name
}
`"
do
subject
{
create
(
:approval_project_rule
,
value
,
:requires_approval
,
project:
project
)
}
let!
(
:result
)
{
subject
.
apply_report_approver_rules_to
(
merge_request
)
}
specify
{
expect
(
merge_request
.
reload
.
approval_rules
).
to
match_array
([
result
])
}
...
...
ee/spec/models/ci/build_spec.rb
View file @
ed0839d1
...
...
@@ -334,6 +334,7 @@ describe Ci::Build do
describe
'#retryable?'
do
subject
{
build
.
retryable?
}
let
(
:pipeline
)
{
merge_request
.
all_pipelines
.
last
}
let!
(
:build
)
{
create
(
:ci_build
,
:canceled
,
pipeline:
pipeline
)
}
...
...
ee/spec/models/ci/pipeline_spec.rb
View file @
ed0839d1
...
...
@@ -526,6 +526,7 @@ describe Ci::Pipeline do
describe
'#retryable?'
do
subject
{
pipeline
.
retryable?
}
let
(
:pipeline
)
{
merge_request
.
all_pipelines
.
last
}
let!
(
:build
)
{
create
(
:ci_build
,
:canceled
,
pipeline:
pipeline
)
}
...
...
ee/spec/models/ee/resource_label_event_spec.rb
View file @
ed0839d1
...
...
@@ -4,6 +4,7 @@ require 'spec_helper'
RSpec
.
describe
ResourceLabelEvent
,
type: :model
do
subject
{
build
(
:resource_label_event
)
}
let
(
:epic
)
{
create
(
:epic
)
}
describe
'validations'
do
...
...
ee/spec/models/merge_request_spec.rb
View file @
ed0839d1
...
...
@@ -162,6 +162,7 @@ describe MergeRequest do
describe
'#has_license_management_reports?'
do
subject
{
merge_request
.
has_license_management_reports?
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
before
do
...
...
@@ -183,6 +184,7 @@ describe MergeRequest do
describe
'#has_dependency_scanning_reports?'
do
subject
{
merge_request
.
has_dependency_scanning_reports?
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
before
do
...
...
@@ -204,6 +206,7 @@ describe MergeRequest do
describe
'#has_container_scanning_reports?'
do
subject
{
merge_request
.
has_container_scanning_reports?
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
before
do
...
...
@@ -225,6 +228,7 @@ describe MergeRequest do
describe
'#has_sast_reports?'
do
subject
{
merge_request
.
has_sast_reports?
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
before
do
...
...
@@ -246,6 +250,7 @@ describe MergeRequest do
describe
'#has_metrics_reports?'
do
subject
{
merge_request
.
has_metrics_reports?
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
before
do
...
...
ee/spec/models/productivity_analytics_spec.rb
View file @
ed0839d1
...
...
@@ -4,6 +4,7 @@ require 'spec_helper'
describe
ProductivityAnalytics
do
subject
(
:analytics
)
{
described_class
.
new
(
merge_requests:
MergeRequest
.
all
,
sort:
custom_sort
)
}
let
(
:custom_sort
)
{
nil
}
let
(
:long_mr
)
do
...
...
ee/spec/models/project_spec.rb
View file @
ed0839d1
...
...
@@ -2115,6 +2115,7 @@ describe Project do
describe
'#allowed_to_share_with_group?'
do
context
'for group related project'
do
subject
(
:project
)
{
build_stubbed
(
:project
,
namespace:
group
,
group:
group
)
}
let
(
:group
)
{
build_stubbed
:group
}
context
'with lock_memberships_to_ldap application setting enabled'
do
...
...
@@ -2128,6 +2129,7 @@ describe Project do
context
'personal project'
do
subject
(
:project
)
{
build_stubbed
(
:project
,
namespace:
namespace
)
}
let
(
:namespace
)
{
build_stubbed
:namespace
}
context
'with lock_memberships_to_ldap application setting enabled'
do
...
...
ee/spec/models/prometheus_alert_event_spec.rb
View file @
ed0839d1
...
...
@@ -4,6 +4,7 @@ require 'spec_helper'
describe
PrometheusAlertEvent
do
subject
{
build
(
:prometheus_alert_event
)
}
let
(
:alert
)
{
subject
.
prometheus_alert
}
describe
'associations'
do
...
...
ee/spec/models/software_license_policy_spec.rb
View file @
ed0839d1
...
...
@@ -15,6 +15,7 @@ describe SoftwareLicensePolicy do
describe
".with_license_by_name"
do
subject
{
described_class
}
let!
(
:mit_policy
)
{
create
(
:software_license_policy
,
software_license:
mit
)
}
let!
(
:mit
)
{
create
(
:software_license
,
:mit
)
}
let!
(
:apache_policy
)
{
create
(
:software_license_policy
,
software_license:
apache
)
}
...
...
ee/spec/models/software_license_spec.rb
View file @
ed0839d1
...
...
@@ -13,6 +13,7 @@ describe SoftwareLicense do
describe
'.create_policy_for!'
do
subject
{
described_class
}
let
(
:project
)
{
create
(
:project
)
}
context
'when a software license with a given name has already been created'
do
...
...
ee/spec/serializers/productivity_analytics_merge_request_entity_spec.rb
View file @
ed0839d1
...
...
@@ -4,6 +4,7 @@ require 'spec_helper'
describe
ProductivityAnalyticsMergeRequestEntity
do
subject
{
described_class
.
represent
(
merge_request
).
as_json
.
with_indifferent_access
}
let
(
:merge_request
)
{
create
(
:merge_request
)
}
before
do
...
...
ee/spec/services/approval_rules/create_service_spec.rb
View file @
ed0839d1
...
...
@@ -86,6 +86,7 @@ describe ApprovalRules::CreateService do
ApprovalProjectRule
::
REPORT_TYPES_BY_DEFAULT_NAME
.
keys
.
each
do
|
rule_name
|
context
"when the rule name is `
#{
rule_name
}
`"
do
subject
{
described_class
.
new
(
target
,
user
,
{
name:
rule_name
,
approvals_required:
1
})
}
let
(
:result
)
{
subject
.
execute
}
specify
{
expect
(
result
[
:status
]).
to
eq
(
:success
)
}
...
...
ee/spec/services/feature_flags/create_service_spec.rb
View file @
ed0839d1
...
...
@@ -18,6 +18,7 @@ describe FeatureFlags::CreateService do
subject
do
described_class
.
new
(
project
,
user
,
params
).
execute
end
let
(
:feature_flag
)
{
subject
[
:feature_flag
]
}
context
'when feature flag can not be created'
do
...
...
ee/spec/services/feature_flags/update_service_spec.rb
View file @
ed0839d1
...
...
@@ -17,6 +17,7 @@ describe FeatureFlags::UpdateService do
describe
'#execute'
do
subject
{
described_class
.
new
(
project
,
user
,
params
).
execute
(
feature_flag
)
}
let
(
:params
)
{
{
name:
'new_name'
}
}
let
(
:audit_event_message
)
do
AuditEvent
.
last
.
present
.
action
...
...
ee/spec/services/geo/project_housekeeping_service_spec.rb
View file @
ed0839d1
...
...
@@ -7,6 +7,7 @@ describe Geo::ProjectHousekeepingService do
include
::
EE
::
GeoHelpers
subject
(
:service
)
{
described_class
.
new
(
project
)
}
set
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:registry
)
{
service
.
registry
}
...
...
ee/spec/services/group_saml/group_managed_accounts/clean_up_members_service_spec.rb
View file @
ed0839d1
...
...
@@ -4,6 +4,7 @@ require 'spec_helper'
describe
GroupSaml
::
GroupManagedAccounts
::
CleanUpMembersService
do
subject
(
:service
)
{
described_class
.
new
(
current_user
,
group
)
}
let
(
:group
)
{
Group
.
new
}
let
(
:current_user
)
{
instance_double
(
'User'
)
}
let
(
:destroy_member_service_spy
)
{
spy
(
'Members::DestroyService'
)
}
...
...
ee/spec/services/group_saml/saml_provider/update_service_spec.rb
View file @
ed0839d1
...
...
@@ -4,6 +4,7 @@ require 'spec_helper'
describe
GroupSaml
::
SamlProvider
::
UpdateService
do
subject
(
:service
)
{
described_class
.
new
(
nil
,
saml_provider
,
params:
params
)
}
let
(
:params
)
do
{
sso_url:
'https://test'
,
...
...
ee/spec/services/merge_requests/sync_report_approver_approval_rules_spec.rb
View file @
ed0839d1
...
...
@@ -4,6 +4,7 @@ require 'spec_helper'
describe
MergeRequests
::
SyncReportApproverApprovalRules
do
subject
(
:service
)
{
described_class
.
new
(
merge_request
)
}
let
(
:merge_request
)
{
create
(
:merge_request
)
}
describe
'#execute'
do
...
...
ee/spec/workers/elastic_batch_project_indexer_worker_spec.rb
View file @
ed0839d1
...
...
@@ -4,6 +4,7 @@ require 'spec_helper'
describe
ElasticBatchProjectIndexerWorker
do
subject
(
:worker
)
{
described_class
.
new
}
let
(
:projects
)
{
create_list
(
:project
,
2
)
}
describe
'#perform'
do
...
...
qa/spec/page/element_spec.rb
View file @
ed0839d1
...
...
@@ -113,6 +113,7 @@ describe QA::Page::Element do
describe
'data-qa selectors'
do
subject
{
described_class
.
new
(
:my_element
)
}
it
'properly translates to a data-qa-selector'
do
expect
(
subject
.
selector_css
).
to
include
(
%q([data-qa-selector="my_element"])
)
end
...
...
spec/controllers/projects/issues_controller_spec.rb
View file @
ed0839d1
...
...
@@ -1180,6 +1180,7 @@ describe Projects::IssuesController do
name:
emoji_name
})
end
let
(
:emoji_name
)
{
'thumbsup'
}
it
"toggles the award emoji"
do
...
...
spec/controllers/projects/notes_controller_spec.rb
View file @
ed0839d1
...
...
@@ -713,6 +713,7 @@ describe Projects::NotesController do
end
subject
{
post
(
:toggle_award_emoji
,
params:
request_params
.
merge
(
name:
emoji_name
))
}
let
(
:emoji_name
)
{
'thumbsup'
}
it
"toggles the award emoji"
do
...
...
spec/controllers/projects/settings/ci_cd_controller_spec.rb
View file @
ed0839d1
...
...
@@ -78,6 +78,7 @@ describe Projects::Settings::CiCdController do
describe
'PUT #reset_registration_token'
do
subject
{
put
:reset_registration_token
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
}
}
it
'resets runner registration token'
do
expect
{
subject
}.
to
change
{
project
.
reload
.
runners_token
}
end
...
...
spec/factories/gitaly/commit.rb
View file @
ed0839d1
...
...
@@ -12,6 +12,7 @@ FactoryBot.define do
Google
::
Protobuf
::
RepeatedField
.
new
(
:string
,
ids
)
end
subject
{
"My commit"
}
body
{
subject
+
"
\n
My body"
}
author
{
build
(
:gitaly_commit_author
)
}
committer
{
build
(
:gitaly_commit_author
)
}
...
...
spec/features/security/group/internal_access_spec.rb
View file @
ed0839d1
...
...
@@ -16,6 +16,7 @@ describe 'Internal Group access' do
describe
"Group should be internal"
do
describe
'#internal?'
do
subject
{
group
.
internal?
}
it
{
is_expected
.
to
be_truthy
}
end
end
...
...
spec/features/security/group/private_access_spec.rb
View file @
ed0839d1
...
...
@@ -16,6 +16,7 @@ describe 'Private Group access' do
describe
"Group should be private"
do
describe
'#private?'
do
subject
{
group
.
private?
}
it
{
is_expected
.
to
be_truthy
}
end
end
...
...
spec/features/security/group/public_access_spec.rb
View file @
ed0839d1
...
...
@@ -16,6 +16,7 @@ describe 'Public Group access' do
describe
"Group should be public"
do
describe
'#public?'
do
subject
{
group
.
public?
}
it
{
is_expected
.
to
be_truthy
}
end
end
...
...
spec/features/security/project/internal_access_spec.rb
View file @
ed0839d1
...
...
@@ -14,6 +14,7 @@ describe "Internal Project Access" do
describe
"Project should be internal"
do
describe
'#internal?'
do
subject
{
project
.
internal?
}
it
{
is_expected
.
to
be_truthy
}
end
end
...
...
spec/features/security/project/private_access_spec.rb
View file @
ed0839d1
...
...
@@ -14,6 +14,7 @@ describe "Private Project Access" do
describe
"Project should be private"
do
describe
'#private?'
do
subject
{
project
.
private?
}
it
{
is_expected
.
to
be_truthy
}
end
end
...
...
spec/features/security/project/public_access_spec.rb
View file @
ed0839d1
...
...
@@ -14,6 +14,7 @@ describe "Public Project Access" do
describe
"Project should be public"
do
describe
'#public?'
do
subject
{
project
.
public?
}
it
{
is_expected
.
to
be_truthy
}
end
end
...
...
spec/finders/clusters/knative_services_finder_spec.rb
View file @
ed0839d1
...
...
@@ -77,6 +77,7 @@ describe Clusters::KnativeServicesFinder do
describe
'#knative_detected'
do
subject
{
finder
.
knative_detected
}
before
do
synchronous_reactive_cache
(
finder
)
end
...
...
spec/finders/concerns/finder_with_cross_project_access_spec.rb
View file @
ed0839d1
...
...
@@ -24,6 +24,7 @@ describe FinderWithCrossProjectAccess do
let
(
:user
)
{
create
(
:user
)
}
subject
(
:finder
)
{
finder_class
.
new
(
user
)
}
let!
(
:result
)
{
create
(
:issue
)
}
before
do
...
...
spec/helpers/merge_requests_helper_spec.rb
View file @
ed0839d1
...
...
@@ -39,6 +39,7 @@ describe MergeRequestsHelper do
let
(
:forked_project
)
{
fork_project
(
project
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
forked_project
,
target_project:
project
)
}
subject
{
format_mr_branch_names
(
merge_request
)
}
let
(
:source_title
)
{
"
#{
forked_project
.
full_path
}
:
#{
merge_request
.
source_branch
}
"
}
let
(
:target_title
)
{
"
#{
project
.
full_path
}
:
#{
merge_request
.
target_branch
}
"
}
...
...
spec/lib/backup/files_spec.rb
View file @
ed0839d1
...
...
@@ -24,6 +24,7 @@ describe Backup::Files do
describe
'#restore'
do
subject
{
described_class
.
new
(
'registry'
,
'/var/gitlab-registry'
)
}
let
(
:timestamp
)
{
Time
.
utc
(
2017
,
3
,
22
)
}
around
do
|
example
|
...
...
spec/lib/banzai/filter/project_reference_filter_spec.rb
View file @
ed0839d1
...
...
@@ -15,6 +15,7 @@ describe Banzai::Filter::ProjectReferenceFilter do
let
(
:project
)
{
create
(
:project
,
:public
)
}
subject
{
project
}
let
(
:subject_name
)
{
"project"
}
let
(
:reference
)
{
get_reference
(
project
)
}
...
...
spec/lib/banzai/filter/user_reference_filter_spec.rb
View file @
ed0839d1
...
...
@@ -12,6 +12,7 @@ describe Banzai::Filter::UserReferenceFilter do
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:user
)
{
create
(
:user
)
}
subject
{
user
}
let
(
:subject_name
)
{
"user"
}
let
(
:reference
)
{
get_reference
(
user
)
}
...
...
spec/lib/banzai/reference_parser/commit_parser_spec.rb
View file @
ed0839d1
...
...
@@ -8,6 +8,7 @@ describe Banzai::ReferenceParser::CommitParser do
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:user
)
{
create
(
:user
)
}
subject
{
described_class
.
new
(
Banzai
::
RenderContext
.
new
(
project
,
user
))
}
let
(
:link
)
{
empty_html_link
}
describe
'#nodes_visible_to_user'
do
...
...
spec/lib/banzai/reference_parser/commit_range_parser_spec.rb
View file @
ed0839d1
...
...
@@ -8,6 +8,7 @@ describe Banzai::ReferenceParser::CommitRangeParser do
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:user
)
{
create
(
:user
)
}
subject
{
described_class
.
new
(
Banzai
::
RenderContext
.
new
(
project
,
user
))
}
let
(
:link
)
{
empty_html_link
}
describe
'#nodes_visible_to_user'
do
...
...
spec/lib/banzai/reference_parser/external_issue_parser_spec.rb
View file @
ed0839d1
...
...
@@ -8,6 +8,7 @@ describe Banzai::ReferenceParser::ExternalIssueParser do
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:user
)
{
create
(
:user
)
}
subject
{
described_class
.
new
(
Banzai
::
RenderContext
.
new
(
project
,
user
))
}
let
(
:link
)
{
empty_html_link
}
describe
'#nodes_visible_to_user'
do
...
...
spec/lib/banzai/reference_parser/label_parser_spec.rb
View file @
ed0839d1
...
...
@@ -9,6 +9,7 @@ describe Banzai::ReferenceParser::LabelParser do
let
(
:user
)
{
create
(
:user
)
}
let
(
:label
)
{
create
(
:label
,
project:
project
)
}
subject
{
described_class
.
new
(
Banzai
::
RenderContext
.
new
(
project
,
user
))
}
let
(
:link
)
{
empty_html_link
}
describe
'#nodes_visible_to_user'
do
...
...
spec/lib/banzai/reference_parser/merge_request_parser_spec.rb
View file @
ed0839d1
...
...
@@ -9,6 +9,7 @@ describe Banzai::ReferenceParser::MergeRequestParser do
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
)
}
subject
{
described_class
.
new
(
Banzai
::
RenderContext
.
new
(
merge_request
.
target_project
,
user
))
}
let
(
:link
)
{
empty_html_link
}
describe
'#nodes_visible_to_user'
do
...
...
spec/lib/banzai/reference_parser/milestone_parser_spec.rb
View file @
ed0839d1
...
...
@@ -9,6 +9,7 @@ describe Banzai::ReferenceParser::MilestoneParser do
let
(
:user
)
{
create
(
:user
)
}
let
(
:milestone
)
{
create
(
:milestone
,
project:
project
)
}
subject
{
described_class
.
new
(
Banzai
::
RenderContext
.
new
(
project
,
user
))
}
let
(
:link
)
{
empty_html_link
}
describe
'#nodes_visible_to_user'
do
...
...
spec/lib/banzai/reference_parser/project_parser_spec.rb
View file @
ed0839d1
...
...
@@ -8,6 +8,7 @@ describe Banzai::ReferenceParser::ProjectParser do
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:user
)
{
create
(
:user
)
}
subject
{
described_class
.
new
(
Banzai
::
RenderContext
.
new
(
project
,
user
))
}
let
(
:link
)
{
empty_html_link
}
describe
'#referenced_by'
do
...
...
spec/lib/banzai/reference_parser/snippet_parser_spec.rb
View file @
ed0839d1
...
...
@@ -12,6 +12,7 @@ describe Banzai::ReferenceParser::SnippetParser do
let
(
:project_member
)
{
create
(
:user
)
}
subject
{
described_class
.
new
(
Banzai
::
RenderContext
.
new
(
project
,
user
))
}
let
(
:link
)
{
empty_html_link
}
def
visible_references
(
snippet_visibility
,
user
=
nil
)
...
...
spec/lib/banzai/reference_parser/user_parser_spec.rb
View file @
ed0839d1
...
...
@@ -9,6 +9,7 @@ describe Banzai::ReferenceParser::UserParser do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
group:
group
,
creator:
user
)
}
subject
{
described_class
.
new
(
Banzai
::
RenderContext
.
new
(
project
,
user
))
}
let
(
:link
)
{
empty_html_link
}
describe
'#referenced_by'
do
...
...
spec/lib/gitlab/ci/build/artifacts/metadata/entry_spec.rb
View file @
ed0839d1
...
...
@@ -34,27 +34,32 @@ describe Gitlab::Ci::Build::Artifacts::Metadata::Entry do
describe
'#basename'
do
subject
{
|
example
|
path
(
example
).
basename
}
it
{
is_expected
.
to
eq
'absolute_path'
}
end
end
describe
'path/dir_1/'
,
path:
'path/dir_1/'
do
subject
{
|
example
|
path
(
example
)
}
it
{
is_expected
.
to
have_parent
}
it
{
is_expected
.
to
be_directory
}
describe
'#basename'
do
subject
{
|
example
|
path
(
example
).
basename
}
it
{
is_expected
.
to
eq
'dir_1/'
}
end
describe
'#name'
do
subject
{
|
example
|
path
(
example
).
name
}
it
{
is_expected
.
to
eq
'dir_1'
}
end
describe
'#parent'
do
subject
{
|
example
|
path
(
example
).
parent
}
it
{
is_expected
.
to
eq
entry
(
'path/'
)
}
end
...
...
@@ -102,21 +107,25 @@ describe Gitlab::Ci::Build::Artifacts::Metadata::Entry do
describe
'#nodes'
do
subject
{
|
example
|
path
(
example
).
nodes
}
it
{
is_expected
.
to
eq
2
}
end
describe
'#exists?'
do
subject
{
|
example
|
path
(
example
).
exists?
}
it
{
is_expected
.
to
be
true
}
end
describe
'#empty?'
do
subject
{
|
example
|
path
(
example
).
empty?
}
it
{
is_expected
.
to
be
false
}
end
describe
'#total_size'
do
subject
{
|
example
|
path
(
example
).
total_size
}
it
{
is_expected
.
to
eq
(
30
)
}
end
end
...
...
@@ -124,10 +133,12 @@ describe Gitlab::Ci::Build::Artifacts::Metadata::Entry do
describe
'empty path'
,
path:
''
do
subject
{
|
example
|
path
(
example
)
}
it
{
is_expected
.
not_to
have_parent
}
describe
'#children'
do
subject
{
|
example
|
path
(
example
).
children
}
it
{
expect
(
subject
.
count
).
to
eq
3
}
end
end
...
...
@@ -135,6 +146,7 @@ describe Gitlab::Ci::Build::Artifacts::Metadata::Entry do
describe
'path/dir_1/subdir/subfile'
,
path:
'path/dir_1/subdir/subfile'
do
describe
'#nodes'
do
subject
{
|
example
|
path
(
example
).
nodes
}
it
{
is_expected
.
to
eq
4
}
end
...
...
@@ -153,11 +165,13 @@ describe Gitlab::Ci::Build::Artifacts::Metadata::Entry do
describe
'non-existent/'
,
path:
'non-existent/'
do
describe
'#empty?'
do
subject
{
|
example
|
path
(
example
).
empty?
}
it
{
is_expected
.
to
be
true
}
end
describe
'#exists?'
do
subject
{
|
example
|
path
(
example
).
exists?
}
it
{
is_expected
.
to
be
false
}
end
end
...
...
@@ -165,6 +179,7 @@ describe Gitlab::Ci::Build::Artifacts::Metadata::Entry do
describe
'another_directory/'
,
path:
'another_directory/'
do
describe
'#empty?'
do
subject
{
|
example
|
path
(
example
).
empty?
}
it
{
is_expected
.
to
be
true
}
end
end
...
...
spec/lib/gitlab/ci/build/artifacts/metadata_spec.rb
View file @
ed0839d1
...
...
@@ -76,21 +76,25 @@ describe Gitlab::Ci::Build::Artifacts::Metadata do
describe
'#to_entry'
do
subject
{
metadata
(
''
).
to_entry
}
it
{
is_expected
.
to
be_an_instance_of
(
Gitlab
::
Ci
::
Build
::
Artifacts
::
Metadata
::
Entry
)
}
end
describe
'#full_version'
do
subject
{
metadata
(
''
).
full_version
}
it
{
is_expected
.
to
eq
'GitLab Build Artifacts Metadata 0.0.1'
}
end
describe
'#version'
do
subject
{
metadata
(
''
).
version
}
it
{
is_expected
.
to
eq
'0.0.1'
}
end
describe
'#errors'
do
subject
{
metadata
(
''
).
errors
}
it
{
is_expected
.
to
eq
({})
}
end
end
...
...
spec/lib/gitlab/ci/config/entry/cache_spec.rb
View file @
ed0839d1
...
...
@@ -69,6 +69,7 @@ describe Gitlab::Ci::Config::Entry::Cache do
context
'when entry value is not correct'
do
describe
'#errors'
do
subject
{
entry
.
errors
}
context
'when is not a hash'
do
let
(
:config
)
{
'ls'
}
...
...
spec/lib/gitlab/ci/config/entry/coverage_spec.rb
View file @
ed0839d1
...
...
@@ -11,11 +11,13 @@ describe Gitlab::Ci::Config::Entry::Coverage do
describe
'#errors'
do
subject
{
entry
.
errors
}
it
{
is_expected
.
to
include
(
/coverage config must be a regular expression/
)
}
end
describe
'#valid?'
do
subject
{
entry
}
it
{
is_expected
.
not_to
be_valid
}
end
end
...
...
@@ -25,16 +27,19 @@ describe Gitlab::Ci::Config::Entry::Coverage do
describe
'#value'
do
subject
{
entry
.
value
}
it
{
is_expected
.
to
eq
(
config
[
1
...-
1
])
}
end
describe
'#errors'
do
subject
{
entry
.
errors
}
it
{
is_expected
.
to
be_empty
}
end
describe
'#valid?'
do
subject
{
entry
}
it
{
is_expected
.
to
be_valid
}
end
end
...
...
@@ -44,11 +49,13 @@ describe Gitlab::Ci::Config::Entry::Coverage do
describe
'#errors'
do
subject
{
entry
.
errors
}
it
{
is_expected
.
to
include
(
/coverage config must be a regular expression/
)
}
end
describe
'#valid?'
do
subject
{
entry
}
it
{
is_expected
.
not_to
be_valid
}
end
end
...
...
spec/lib/gitlab/cleanup/project_uploads_spec.rb
View file @
ed0839d1
...
...
@@ -4,6 +4,7 @@ require 'spec_helper'
describe
Gitlab
::
Cleanup
::
ProjectUploads
do
subject
{
described_class
.
new
(
logger:
logger
)
}
let
(
:logger
)
{
double
(
:logger
)
}
before
do
...
...
spec/lib/gitlab/danger/teammate_spec.rb
View file @
ed0839d1
...
...
@@ -8,6 +8,7 @@ require 'gitlab/danger/teammate'
describe
Gitlab
::
Danger
::
Teammate
do
subject
{
described_class
.
new
(
options
.
stringify_keys
)
}
let
(
:options
)
{
{
username:
'luigi'
,
projects:
projects
,
role:
role
}
}
let
(
:projects
)
{
{
project
=>
capabilities
}
}
let
(
:role
)
{
'Engineer, Manage'
}
...
...
spec/lib/gitlab/downtime_check_spec.rb
View file @
ed0839d1
...
...
@@ -4,6 +4,7 @@ require 'spec_helper'
describe
Gitlab
::
DowntimeCheck
do
subject
{
described_class
.
new
}
let
(
:path
)
{
'foo.rb'
}
describe
'#check'
do
...
...
spec/lib/gitlab/email/message/repository_push_spec.rb
View file @
ed0839d1
...
...
@@ -28,90 +28,107 @@ describe Gitlab::Email::Message::RepositoryPush do
describe
'#project'
do
subject
{
message
.
project
}
it
{
is_expected
.
to
eq
project
}
it
{
is_expected
.
to
be_an_instance_of
Project
}
end
describe
'#project_namespace'
do
subject
{
message
.
project_namespace
}
it
{
is_expected
.
to
eq
group
}
it
{
is_expected
.
to
be_kind_of
Namespace
}
end
describe
'#project_name_with_namespace'
do
subject
{
message
.
project_name_with_namespace
}
it
{
is_expected
.
to
eq
"
#{
group
.
name
}
/
#{
project
.
path
}
"
}
end
describe
'#author'
do
subject
{
message
.
author
}
it
{
is_expected
.
to
eq
author
}
it
{
is_expected
.
to
be_an_instance_of
User
}
end
describe
'#author_name'
do
subject
{
message
.
author_name
}
it
{
is_expected
.
to
eq
'Author'
}
end
describe
'#commits'
do
subject
{
message
.
commits
}
it
{
is_expected
.
to
be_kind_of
Array
}
it
{
is_expected
.
to
all
(
be_instance_of
Commit
)
}
end
describe
'#diffs'
do
subject
{
message
.
diffs
}
it
{
is_expected
.
to
all
(
be_an_instance_of
Gitlab
::
Diff
::
File
)
}
end
describe
'#diffs_count'
do
subject
{
message
.
diffs_count
}
it
{
is_expected
.
to
eq
raw_compare
.
diffs
.
size
}
end
describe
'#compare'
do
subject
{
message
.
compare
}
it
{
is_expected
.
to
be_an_instance_of
Compare
}
end
describe
'#compare_timeout'
do
subject
{
message
.
compare_timeout
}
it
{
is_expected
.
to
eq
raw_compare
.
diffs
.
overflow?
}
end
describe
'#reverse_compare?'
do
subject
{
message
.
reverse_compare?
}
it
{
is_expected
.
to
eq
false
}
end
describe
'#disable_diffs?'
do
subject
{
message
.
disable_diffs?
}
it
{
is_expected
.
to
eq
false
}
end
describe
'#send_from_committer_email?'
do
subject
{
message
.
send_from_committer_email?
}
it
{
is_expected
.
to
eq
true
}
end
describe
'#action_name'
do
subject
{
message
.
action_name
}
it
{
is_expected
.
to
eq
'pushed to'
}
end
describe
'#ref_name'
do
subject
{
message
.
ref_name
}
it
{
is_expected
.
to
eq
'master'
}
end
describe
'#ref_type'
do
subject
{
message
.
ref_type
}
it
{
is_expected
.
to
eq
'branch'
}
end
describe
'#target_url'
do
subject
{
message
.
target_url
}
it
{
is_expected
.
to
include
'compare'
}
it
{
is_expected
.
to
include
compare
.
commits
.
first
.
parents
.
first
.
id
}
it
{
is_expected
.
to
include
compare
.
commits
.
last
.
id
}
...
...
@@ -119,6 +136,7 @@ describe Gitlab::Email::Message::RepositoryPush do
describe
'#subject'
do
subject
{
message
.
subject
}
it
{
is_expected
.
to
include
"[Git][
#{
project
.
full_path
}
]"
}
it
{
is_expected
.
to
include
"
#{
compare
.
commits
.
length
}
commits"
}
it
{
is_expected
.
to
include
compare
.
commits
.
first
.
message
.
split
(
"
\n
"
).
first
}
...
...
spec/lib/gitlab/experimentation_spec.rb
View file @
ed0839d1
...
...
@@ -75,6 +75,7 @@ describe Gitlab::Experimentation do
describe
'.enabled?'
do
subject
{
described_class
.
enabled?
(
:test_experiment
,
experimentation_subject_index
)
}
let
(
:experimentation_subject_index
)
{
9
}
context
'feature toggle is enabled, we are on the right environment and we are selected'
do
...
...
spec/lib/gitlab/gfm/uploads_rewriter_spec.rb
View file @
ed0839d1
...
...
@@ -84,11 +84,13 @@ describe Gitlab::Gfm::UploadsRewriter do
describe
'#needs_rewrite?'
do
subject
{
rewriter
.
needs_rewrite?
}
it
{
is_expected
.
to
eq
true
}
end
describe
'#files'
do
subject
{
rewriter
.
files
}
it
{
is_expected
.
to
be_an
(
Array
)
}
end
end
...
...
spec/lib/gitlab/git/branch_spec.rb
View file @
ed0839d1
...
...
@@ -44,6 +44,7 @@ describe Gitlab::Git::Branch, :seed_helper do
describe
'#size'
do
subject
{
super
().
size
}
it
{
is_expected
.
to
eq
(
SeedRepo
::
Repo
::
BRANCHES
.
size
)
}
end
...
...
spec/lib/gitlab/git/commit_spec.rb
View file @
ed0839d1
...
...
@@ -174,6 +174,7 @@ describe Gitlab::Git::Commit, :seed_helper do
describe
'#id'
do
subject
{
super
().
id
}
it
{
is_expected
.
to
eq
(
SeedRepo
::
LastCommit
::
ID
)
}
end
end
...
...
@@ -183,6 +184,7 @@ describe Gitlab::Git::Commit, :seed_helper do
describe
'#id'
do
subject
{
super
().
id
}
it
{
is_expected
.
to
eq
(
SeedRepo
::
Commit
::
ID
)
}
end
end
...
...
@@ -192,6 +194,7 @@ describe Gitlab::Git::Commit, :seed_helper do
describe
'#id'
do
subject
{
super
().
id
}
it
{
is_expected
.
to
eq
(
SeedRepo
::
BigCommit
::
ID
)
}
end
end
...
...
@@ -544,11 +547,13 @@ describe Gitlab::Git::Commit, :seed_helper do
describe
'#id'
do
subject
{
super
().
id
}
it
{
is_expected
.
to
eq
(
sample_commit_hash
[
:id
])}
end
describe
'#message'
do
subject
{
super
().
message
}
it
{
is_expected
.
to
eq
(
sample_commit_hash
[
:message
])}
end
end
...
...
@@ -558,16 +563,19 @@ describe Gitlab::Git::Commit, :seed_helper do
describe
'#additions'
do
subject
{
super
().
additions
}
it
{
is_expected
.
to
eq
(
11
)
}
end
describe
'#deletions'
do
subject
{
super
().
deletions
}
it
{
is_expected
.
to
eq
(
6
)
}
end
describe
'#total'
do
subject
{
super
().
total
}
it
{
is_expected
.
to
eq
(
17
)
}
end
end
...
...
@@ -596,6 +604,7 @@ describe Gitlab::Git::Commit, :seed_helper do
describe
'#keys'
do
subject
{
super
().
keys
.
sort
}
it
{
is_expected
.
to
match
(
sample_commit_hash
.
keys
.
sort
)
}
end
end
...
...
spec/lib/gitlab/git/diff_collection_spec.rb
View file @
ed0839d1
...
...
@@ -10,6 +10,7 @@ describe Gitlab::Git::DiffCollection, :seed_helper do
expanded:
expanded
)
end
let
(
:iterator
)
{
MutatingConstantIterator
.
new
(
file_count
,
fake_diff
(
line_length
,
line_count
))
}
let
(
:file_count
)
{
0
}
let
(
:line_length
)
{
1
}
...
...
@@ -21,6 +22,7 @@ describe Gitlab::Git::DiffCollection, :seed_helper do
describe
'#to_a'
do
subject
{
super
().
to_a
}
it
{
is_expected
.
to
be_kind_of
::
Array
}
end
...
...
@@ -52,16 +54,19 @@ describe Gitlab::Git::DiffCollection, :seed_helper do
describe
'#overflow?'
do
subject
{
super
().
overflow?
}
it
{
is_expected
.
to
be_falsey
}
end
describe
'#empty?'
do
subject
{
super
().
empty?
}
it
{
is_expected
.
to
be_falsey
}
end
describe
'#real_size'
do
subject
{
super
().
real_size
}
it
{
is_expected
.
to
eq
(
'3'
)
}
end
...
...
@@ -76,6 +81,7 @@ describe Gitlab::Git::DiffCollection, :seed_helper do
describe
'#line_count'
do
subject
{
super
().
line_count
}
it
{
is_expected
.
to
eq
file_count
*
line_count
}
end
...
...
@@ -84,16 +90,19 @@ describe Gitlab::Git::DiffCollection, :seed_helper do
describe
'#overflow?'
do
subject
{
super
().
overflow?
}
it
{
is_expected
.
to
be_falsey
}
end
describe
'#empty?'
do
subject
{
super
().
empty?
}
it
{
is_expected
.
to
be_falsey
}
end
describe
'#real_size'
do
subject
{
super
().
real_size
}
it
{
is_expected
.
to
eq
(
'3'
)
}
end
...
...
@@ -108,6 +117,7 @@ describe Gitlab::Git::DiffCollection, :seed_helper do
describe
'#line_count'
do
subject
{
super
().
line_count
}
it
{
is_expected
.
to
eq
file_count
*
line_count
}
end
end
...
...
@@ -118,21 +128,25 @@ describe Gitlab::Git::DiffCollection, :seed_helper do
describe
'#overflow?'
do
subject
{
super
().
overflow?
}
it
{
is_expected
.
to
be_truthy
}
end
describe
'#empty?'
do
subject
{
super
().
empty?
}
it
{
is_expected
.
to
be_falsey
}
end
describe
'#real_size'
do
subject
{
super
().
real_size
}
it
{
is_expected
.
to
eq
(
'0+'
)
}
end
describe
'#line_count'
do
subject
{
super
().
line_count
}
it
{
is_expected
.
to
eq
1000
}
end
...
...
@@ -143,21 +157,25 @@ describe Gitlab::Git::DiffCollection, :seed_helper do
describe
'#overflow?'
do
subject
{
super
().
overflow?
}
it
{
is_expected
.
to
be_falsey
}
end
describe
'#empty?'
do
subject
{
super
().
empty?
}
it
{
is_expected
.
to
be_falsey
}
end
describe
'#real_size'
do
subject
{
super
().
real_size
}
it
{
is_expected
.
to
eq
(
'3'
)
}
end
describe
'#line_count'
do
subject
{
super
().
line_count
}
it
{
is_expected
.
to
eq
file_count
*
line_count
}
end
...
...
@@ -174,21 +192,25 @@ describe Gitlab::Git::DiffCollection, :seed_helper do
describe
'#overflow?'
do
subject
{
super
().
overflow?
}
it
{
is_expected
.
to
be_truthy
}
end
describe
'#empty?'
do
subject
{
super
().
empty?
}
it
{
is_expected
.
to
be_falsey
}
end
describe
'#real_size'
do
subject
{
super
().
real_size
}
it
{
is_expected
.
to
eq
(
'10+'
)
}
end
describe
'#line_count'
do
subject
{
super
().
line_count
}
it
{
is_expected
.
to
eq
10
}
end
...
...
@@ -199,21 +221,25 @@ describe Gitlab::Git::DiffCollection, :seed_helper do
describe
'#overflow?'
do
subject
{
super
().
overflow?
}
it
{
is_expected
.
to
be_falsey
}
end
describe
'#empty?'
do
subject
{
super
().
empty?
}
it
{
is_expected
.
to
be_falsey
}
end
describe
'#real_size'
do
subject
{
super
().
real_size
}
it
{
is_expected
.
to
eq
(
'11'
)
}
end
describe
'#line_count'
do
subject
{
super
().
line_count
}
it
{
is_expected
.
to
eq
file_count
*
line_count
}
end
...
...
@@ -226,21 +252,25 @@ describe Gitlab::Git::DiffCollection, :seed_helper do
describe
'#overflow?'
do
subject
{
super
().
overflow?
}
it
{
is_expected
.
to
be_truthy
}
end
describe
'#empty?'
do
subject
{
super
().
empty?
}
it
{
is_expected
.
to
be_falsey
}
end
describe
'#real_size'
do
subject
{
super
().
real_size
}
it
{
is_expected
.
to
eq
(
'3+'
)
}
end
describe
'#line_count'
do
subject
{
super
().
line_count
}
it
{
is_expected
.
to
eq
120
}
end
...
...
@@ -251,21 +281,25 @@ describe Gitlab::Git::DiffCollection, :seed_helper do
describe
'#overflow?'
do
subject
{
super
().
overflow?
}
it
{
is_expected
.
to
be_falsey
}
end
describe
'#empty?'
do
subject
{
super
().
empty?
}
it
{
is_expected
.
to
be_falsey
}
end
describe
'#real_size'
do
subject
{
super
().
real_size
}
it
{
is_expected
.
to
eq
(
'11'
)
}
end
describe
'#line_count'
do
subject
{
super
().
line_count
}
it
{
is_expected
.
to
eq
file_count
*
line_count
}
end
...
...
@@ -282,21 +316,25 @@ describe Gitlab::Git::DiffCollection, :seed_helper do
describe
'#overflow?'
do
subject
{
super
().
overflow?
}
it
{
is_expected
.
to
be_falsey
}
end
describe
'#empty?'
do
subject
{
super
().
empty?
}
it
{
is_expected
.
to
be_falsey
}
end
describe
'#real_size'
do
subject
{
super
().
real_size
}
it
{
is_expected
.
to
eq
(
'10'
)
}
end
describe
'#line_count'
do
subject
{
super
().
line_count
}
it
{
is_expected
.
to
eq
file_count
*
line_count
}
end
...
...
@@ -310,21 +348,25 @@ describe Gitlab::Git::DiffCollection, :seed_helper do
describe
'#overflow?'
do
subject
{
super
().
overflow?
}
it
{
is_expected
.
to
be_truthy
}
end
describe
'#empty?'
do
subject
{
super
().
empty?
}
it
{
is_expected
.
to
be_falsey
}
end
describe
'#real_size'
do
subject
{
super
().
real_size
}
it
{
is_expected
.
to
eq
(
'9+'
)
}
end
describe
'#line_count'
do
subject
{
super
().
line_count
}
it
{
is_expected
.
to
eq
file_count
*
line_count
}
end
...
...
@@ -335,21 +377,25 @@ describe Gitlab::Git::DiffCollection, :seed_helper do
describe
'#overflow?'
do
subject
{
super
().
overflow?
}
it
{
is_expected
.
to
be_falsey
}
end
describe
'#empty?'
do
subject
{
super
().
empty?
}
it
{
is_expected
.
to
be_falsey
}
end
describe
'#real_size'
do
subject
{
super
().
real_size
}
it
{
is_expected
.
to
eq
(
'10'
)
}
end
describe
'#line_count'
do
subject
{
super
().
line_count
}
it
{
is_expected
.
to
eq
file_count
*
line_count
}
end
...
...
@@ -363,26 +409,31 @@ describe Gitlab::Git::DiffCollection, :seed_helper do
describe
'#overflow?'
do
subject
{
super
().
overflow?
}
it
{
is_expected
.
to
be_falsey
}
end
describe
'#empty?'
do
subject
{
super
().
empty?
}
it
{
is_expected
.
to
be_truthy
}
end
describe
'#size'
do
subject
{
super
().
size
}
it
{
is_expected
.
to
eq
(
0
)
}
end
describe
'#real_size'
do
subject
{
super
().
real_size
}
it
{
is_expected
.
to
eq
(
'0'
)}
end
describe
'#line_count'
do
subject
{
super
().
line_count
}
it
{
is_expected
.
to
eq
0
}
end
end
...
...
spec/lib/gitlab/git/repository_spec.rb
View file @
ed0839d1
...
...
@@ -93,6 +93,7 @@ describe Gitlab::Git::Repository, :seed_helper do
describe
'#last'
do
subject
{
super
().
last
}
it
{
is_expected
.
to
eq
(
"v1.2.1"
)
}
end
it
{
is_expected
.
to
include
(
"v1.0.0"
)
}
...
...
@@ -215,11 +216,13 @@ describe Gitlab::Git::Repository, :seed_helper do
describe
'#first'
do
subject
{
super
().
first
}
it
{
is_expected
.
to
eq
(
'feature'
)
}
end
describe
'#last'
do
subject
{
super
().
last
}
it
{
is_expected
.
to
eq
(
'v1.2.1'
)
}
end
end
...
...
spec/lib/gitlab/gitlab_import/client_spec.rb
View file @
ed0839d1
...
...
@@ -52,6 +52,7 @@ describe Gitlab::GitlabImport::Client do
describe
'#projects'
do
subject
(
:method
)
{
:projects
}
let
(
:args
)
{
[]
}
let
(
:element_list
)
{
build_list
(
:project
,
2
)
}
...
...
@@ -67,6 +68,7 @@ describe Gitlab::GitlabImport::Client do
describe
'#issues'
do
subject
(
:method
)
{
:issues
}
let
(
:args
)
{
[
1
]
}
let
(
:element_list
)
{
build_list
(
:issue
,
2
)
}
...
...
@@ -82,6 +84,7 @@ describe Gitlab::GitlabImport::Client do
describe
'#issue_comments'
do
subject
(
:method
)
{
:issue_comments
}
let
(
:args
)
{
[
1
,
1
]
}
let
(
:element_list
)
{
build_list
(
:note_on_issue
,
2
)
}
...
...
spec/lib/gitlab/graphs/commits_spec.rb
View file @
ed0839d1
...
...
@@ -11,12 +11,14 @@ describe Gitlab::Graphs::Commits do
describe
'#commit_per_day'
do
context
'when range is only commits from today'
do
subject
{
described_class
.
new
([
commit2
,
commit1
]).
commit_per_day
}
it
{
is_expected
.
to
eq
2
}
end
end
context
'when range is only commits from today'
do
subject
{
described_class
.
new
([
commit2
,
commit1
])
}
describe
'#commit_per_day'
do
it
{
expect
(
subject
.
commit_per_day
).
to
eq
2
}
end
...
...
@@ -28,6 +30,7 @@ describe Gitlab::Graphs::Commits do
context
'with commits from yesterday and today'
do
subject
{
described_class
.
new
([
commit2
,
commit1_yesterday
])
}
describe
'#commit_per_day'
do
it
{
expect
(
subject
.
commit_per_day
).
to
eq
1.0
}
end
...
...
spec/lib/gitlab/health_checks/gitaly_check_spec.rb
View file @
ed0839d1
...
...
@@ -30,6 +30,7 @@ describe Gitlab::HealthChecks::GitalyCheck do
describe
'#metrics'
do
subject
{
described_class
.
metrics
}
let
(
:server
)
{
double
(
storage:
'default'
,
read_writeable?:
up
)
}
before
do
...
...
spec/lib/gitlab/health_checks/simple_check_shared.rb
View file @
ed0839d1
shared_context
'simple_check'
do
|
metrics_prefix
,
check_name
,
success_result
|
describe
'#metrics'
do
subject
{
described_class
.
metrics
}
context
'Check is passing'
do
before
do
allow
(
described_class
).
to
receive
(
:check
).
and_return
success_result
...
...
@@ -34,6 +35,7 @@ shared_context 'simple_check' do |metrics_prefix, check_name, success_result|
describe
'#readiness'
do
subject
{
described_class
.
readiness
}
context
'Check returns ok'
do
before
do
allow
(
described_class
).
to
receive
(
:check
).
and_return
success_result
...
...
spec/lib/gitlab/metrics/samplers/puma_sampler_spec.rb
View file @
ed0839d1
...
...
@@ -4,6 +4,7 @@ require 'spec_helper'
describe
Gitlab
::
Metrics
::
Samplers
::
PumaSampler
do
subject
{
described_class
.
new
(
5
)
}
let
(
:null_metric
)
{
double
(
'null_metric'
,
set:
nil
,
observe:
nil
)
}
before
do
...
...
spec/lib/gitlab/phabricator_import/worker_state_spec.rb
View file @
ed0839d1
...
...
@@ -4,6 +4,7 @@ require 'spec_helper'
describe
Gitlab
::
PhabricatorImport
::
WorkerState
,
:clean_gitlab_redis_shared_state
do
subject
(
:state
)
{
described_class
.
new
(
'weird-project-id'
)
}
let
(
:key
)
{
'phabricator-import/jobs/project-weird-project-id/job-count'
}
describe
'#add_job'
do
...
...
spec/lib/gitlab/reference_extractor_spec.rb
View file @
ed0839d1
...
...
@@ -259,6 +259,7 @@ describe Gitlab::ReferenceExtractor do
describe
'.references_pattern'
do
subject
{
described_class
.
references_pattern
}
it
{
is_expected
.
to
be_kind_of
Regexp
}
end
...
...
spec/lib/gitlab/request_context_spec.rb
View file @
ed0839d1
...
...
@@ -5,6 +5,7 @@ require 'spec_helper'
describe
Gitlab
::
RequestContext
do
describe
'#client_ip'
do
subject
{
described_class
.
client_ip
}
let
(
:app
)
{
->
(
env
)
{}
}
let
(
:env
)
{
Hash
.
new
}
...
...
spec/lib/gitlab/shell_spec.rb
View file @
ed0839d1
...
...
@@ -396,6 +396,7 @@ describe Gitlab::Shell do
describe
'namespace actions'
do
subject
{
described_class
.
new
}
let
(
:storage
)
{
Gitlab
.
config
.
repositories
.
storages
.
keys
.
first
}
describe
'#add_namespace'
do
...
...
spec/lib/gitlab/sidekiq_middleware/memory_killer_spec.rb
View file @
ed0839d1
...
...
@@ -4,6 +4,7 @@ require 'spec_helper'
describe
Gitlab
::
SidekiqMiddleware
::
MemoryKiller
do
subject
{
described_class
.
new
}
let
(
:pid
)
{
999
}
let
(
:worker
)
{
double
(
:worker
,
class:
ProjectCacheWorker
)
}
...
...
spec/lib/gitlab/utils/override_spec.rb
View file @
ed0839d1
...
...
@@ -151,6 +151,7 @@ describe Gitlab::Utils::Override do
context
'when subject is a module, and class is prepending it'
do
subject
{
extension
}
let
(
:klass
)
{
prepending_class
}
it_behaves_like
'checking as intended'
...
...
@@ -158,6 +159,7 @@ describe Gitlab::Utils::Override do
context
'when subject is a module, and class is including it'
do
subject
{
extension
}
let
(
:klass
)
{
including_class
}
it_behaves_like
'checking as intended, nothing was overridden'
...
...
@@ -177,6 +179,7 @@ describe Gitlab::Utils::Override do
context
'when subject is a module, and class is prepending it'
do
subject
{
extension
}
let
(
:klass
)
{
prepending_class
}
it_behaves_like
'nothing happened'
...
...
@@ -184,6 +187,7 @@ describe Gitlab::Utils::Override do
context
'when subject is a module, and class is including it'
do
subject
{
extension
}
let
(
:klass
)
{
including_class
}
it
'does not complain when it is overriding something'
do
...
...
@@ -215,6 +219,7 @@ describe Gitlab::Utils::Override do
context
'when subject is a module, and class is prepending it'
do
subject
{
extension
}
let
(
:klass
)
{
prepending_class_methods
}
it_behaves_like
'checking as intended'
...
...
@@ -222,6 +227,7 @@ describe Gitlab::Utils::Override do
context
'when subject is a module, and class is extending it'
do
subject
{
extension
}
let
(
:klass
)
{
extending_class_methods
}
it_behaves_like
'checking as intended, nothing was overridden'
...
...
spec/lib/google_api/cloud_platform/client_spec.rb
View file @
ed0839d1
...
...
@@ -54,6 +54,7 @@ describe GoogleApi::CloudPlatform::Client do
describe
'#projects_zones_clusters_get'
do
subject
{
client
.
projects_zones_clusters_get
(
spy
,
spy
,
spy
)
}
let
(
:gke_cluster
)
{
double
}
before
do
...
...
@@ -160,6 +161,7 @@ describe GoogleApi::CloudPlatform::Client do
describe
'#projects_zones_operations'
do
subject
{
client
.
projects_zones_operations
(
spy
,
spy
,
spy
)
}
let
(
:operation
)
{
double
}
before
do
...
...
spec/lib/json_web_token/token_spec.rb
View file @
ed0839d1
...
...
@@ -16,6 +16,7 @@ describe JSONWebToken::Token do
context
'embeds default payload'
do
subject
{
token
.
payload
}
let
(
:default
)
{
token
.
send
(
:default_payload
)
}
it
{
is_expected
.
to
include
(
default
)
}
...
...
spec/lib/omni_auth/strategies/jwt_spec.rb
View file @
ed0839d1
...
...
@@ -8,6 +8,7 @@ describe OmniAuth::Strategies::Jwt do
context
'#decoded'
do
subject
{
described_class
.
new
({})
}
let
(
:timestamp
)
{
Time
.
now
.
to_i
}
let
(
:jwt_config
)
{
Devise
.
omniauth_configs
[
:jwt
]
}
let
(
:claims
)
do
...
...
spec/models/ci/build_spec.rb
View file @
ed0839d1
...
...
@@ -574,6 +574,7 @@ describe Ci::Build do
describe
'#artifacts_metadata?'
do
subject
{
build
.
artifacts_metadata?
}
context
'artifacts metadata does not exist'
do
it
{
is_expected
.
to
be_falsy
}
end
...
...
@@ -586,6 +587,7 @@ describe Ci::Build do
describe
'#artifacts_expire_in'
do
subject
{
build
.
artifacts_expire_in
}
it
{
is_expected
.
to
be_nil
}
context
'when artifacts_expire_at is specified'
do
...
...
@@ -1265,6 +1267,7 @@ describe Ci::Build do
describe
'#erasable?'
do
subject
{
build
.
erasable?
}
it
{
is_expected
.
to
be_truthy
}
end
...
...
spec/models/ci/runner_spec.rb
View file @
ed0839d1
...
...
@@ -686,11 +686,13 @@ describe Ci::Runner do
describe
'#has_tags?'
do
context
'when runner has tags'
do
subject
{
create
(
:ci_runner
,
tag_list:
[
'tag'
])
}
it
{
is_expected
.
to
have_tags
}
end
context
'when runner does not have tags'
do
subject
{
create
(
:ci_runner
,
tag_list:
[])
}
it
{
is_expected
.
not_to
have_tags
}
end
end
...
...
spec/models/concerns/noteable_spec.rb
View file @
ed0839d1
...
...
@@ -6,6 +6,7 @@ describe Noteable do
let!
(
:active_diff_note1
)
{
create
(
:diff_note_on_merge_request
)
}
let
(
:project
)
{
active_diff_note1
.
project
}
subject
{
active_diff_note1
.
noteable
}
let!
(
:active_diff_note2
)
{
create
(
:diff_note_on_merge_request
,
project:
project
,
noteable:
subject
,
in_reply_to:
active_diff_note1
)
}
let!
(
:active_diff_note3
)
{
create
(
:diff_note_on_merge_request
,
project:
project
,
noteable:
subject
,
position:
active_position2
)
}
let!
(
:outdated_diff_note1
)
{
create
(
:diff_note_on_merge_request
,
project:
project
,
noteable:
subject
,
position:
outdated_position
)
}
...
...
spec/models/concerns/token_authenticatable_spec.rb
View file @
ed0839d1
...
...
@@ -17,6 +17,7 @@ describe User, 'TokenAuthenticatable' do
describe
'ensures authentication token'
do
subject
{
create
(
:user
).
send
(
token_field
)
}
it
{
is_expected
.
to
be_a
String
}
end
end
...
...
spec/models/deploy_keys_project_spec.rb
View file @
ed0839d1
...
...
@@ -16,6 +16,7 @@ describe DeployKeysProject do
describe
"Destroying"
do
let
(
:project
)
{
create
(
:project
)
}
subject
{
create
(
:deploy_keys_project
,
project:
project
)
}
let
(
:deploy_key
)
{
subject
.
deploy_key
}
context
"when the deploy key is only used by this project"
do
...
...
spec/models/event_spec.rb
View file @
ed0839d1
...
...
@@ -100,26 +100,31 @@ describe Event do
describe
'#membership_changed?'
do
context
"created"
do
subject
{
build
(
:event
,
:created
).
membership_changed?
}
it
{
is_expected
.
to
be_falsey
}
end
context
"updated"
do
subject
{
build
(
:event
,
:updated
).
membership_changed?
}
it
{
is_expected
.
to
be_falsey
}
end
context
"expired"
do
subject
{
build
(
:event
,
:expired
).
membership_changed?
}
it
{
is_expected
.
to
be_truthy
}
end
context
"left"
do
subject
{
build
(
:event
,
:left
).
membership_changed?
}
it
{
is_expected
.
to
be_truthy
}
end
context
"joined"
do
subject
{
build
(
:event
,
:joined
).
membership_changed?
}
it
{
is_expected
.
to
be_truthy
}
end
end
...
...
spec/models/gpg_signature_spec.rb
View file @
ed0839d1
...
...
@@ -20,6 +20,7 @@ RSpec.describe GpgSignature do
describe
'validation'
do
subject
{
described_class
.
new
}
it
{
is_expected
.
to
validate_presence_of
(
:commit_sha
)
}
it
{
is_expected
.
to
validate_presence_of
(
:project_id
)
}
it
{
is_expected
.
to
validate_presence_of
(
:gpg_key_primary_keyid
)
}
...
...
spec/models/issue_spec.rb
View file @
ed0839d1
...
...
@@ -277,6 +277,7 @@ describe Issue do
context
'checking destination project also'
do
subject
{
issue
.
can_move?
(
user
,
to_project
)
}
let
(
:to_project
)
{
create
(
:project
)
}
context
'destination project allowed'
do
...
...
spec/models/merge_request_spec.rb
View file @
ed0839d1
...
...
@@ -541,6 +541,7 @@ describe MergeRequest do
context
'with diffs'
do
subject
{
create
(
:merge_request
,
:with_diffs
)
}
it
'returns the sha of the source branch last commit'
do
expect
(
subject
.
source_branch_sha
).
to
eq
(
last_branch_commit
.
sha
)
end
...
...
@@ -548,6 +549,7 @@ describe MergeRequest do
context
'without diffs'
do
subject
{
create
(
:merge_request
,
:without_diffs
)
}
it
'returns the sha of the source branch last commit'
do
expect
(
subject
.
source_branch_sha
).
to
eq
(
last_branch_commit
.
sha
)
end
...
...
@@ -570,6 +572,7 @@ describe MergeRequest do
context
'when the merge request is being created'
do
subject
{
build
(
:merge_request
,
source_branch:
nil
,
compare_commits:
[])
}
it
'returns nil'
do
expect
(
subject
.
source_branch_sha
).
to
be_nil
end
...
...
@@ -2495,6 +2498,7 @@ describe MergeRequest do
describe
"#diff_refs"
do
context
"with diffs"
do
subject
{
create
(
:merge_request
,
:with_diffs
)
}
let
(
:expected_diff_refs
)
do
Gitlab
::
Diff
::
DiffRefs
.
new
(
base_sha:
subject
.
merge_request_diff
.
base_commit_sha
,
...
...
@@ -2840,6 +2844,7 @@ describe MergeRequest do
describe
'#merge_request_diff_for'
do
subject
{
create
(
:merge_request
,
importing:
true
)
}
let!
(
:merge_request_diff1
)
{
subject
.
merge_request_diffs
.
create
(
head_commit_sha:
'6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9'
)
}
let!
(
:merge_request_diff2
)
{
subject
.
merge_request_diffs
.
create
(
head_commit_sha:
nil
)
}
let!
(
:merge_request_diff3
)
{
subject
.
merge_request_diffs
.
create
(
head_commit_sha:
'5937ac0a7beb003549fc5fd26fc247adbce4a52e'
)
}
...
...
@@ -2870,6 +2875,7 @@ describe MergeRequest do
describe
'#version_params_for'
do
subject
{
create
(
:merge_request
,
importing:
true
)
}
let
(
:project
)
{
subject
.
project
}
let!
(
:merge_request_diff1
)
{
subject
.
merge_request_diffs
.
create
(
head_commit_sha:
'6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9'
)
}
let!
(
:merge_request_diff2
)
{
subject
.
merge_request_diffs
.
create
(
head_commit_sha:
nil
)
}
...
...
spec/models/note_spec.rb
View file @
ed0839d1
...
...
@@ -55,11 +55,13 @@ describe Note do
context
'when noteable and note project are the same'
do
subject
{
create
(
:note
)
}
it
{
is_expected
.
to
be_valid
}
end
context
'when project is missing for a project related note'
do
subject
{
build
(
:note
,
project:
nil
,
noteable:
build_stubbed
(
:issue
))
}
it
{
is_expected
.
to
be_invalid
}
end
...
...
@@ -741,6 +743,7 @@ describe Note do
describe
'#to_discussion'
do
subject
{
create
(
:discussion_note_on_merge_request
)
}
let!
(
:note2
)
{
create
(
:discussion_note_on_merge_request
,
project:
subject
.
project
,
noteable:
subject
.
noteable
,
in_reply_to:
subject
)
}
it
"returns a discussion with just this note"
do
...
...
@@ -808,6 +811,7 @@ describe Note do
context
'for a note'
do
context
'when part of a discussion'
do
subject
{
create
(
:discussion_note_on_issue
)
}
let
(
:note
)
{
create
(
:discussion_note_on_issue
,
in_reply_to:
subject
)
}
it
'checks if the note is in reply to the other discussion'
do
...
...
@@ -821,6 +825,7 @@ describe Note do
context
'when not part of a discussion'
do
subject
{
create
(
:note
)
}
let
(
:note
)
{
create
(
:note
,
in_reply_to:
subject
)
}
it
'checks if the note is in reply to the other noteable'
do
...
...
@@ -835,6 +840,7 @@ describe Note do
context
'for a discussion'
do
context
'when part of the same discussion'
do
subject
{
create
(
:diff_note_on_merge_request
)
}
let
(
:note
)
{
create
(
:diff_note_on_merge_request
,
in_reply_to:
subject
)
}
it
'returns true'
do
...
...
@@ -844,6 +850,7 @@ describe Note do
context
'when not part of the same discussion'
do
subject
{
create
(
:diff_note_on_merge_request
)
}
let
(
:note
)
{
create
(
:diff_note_on_merge_request
)
}
it
'returns false'
do
...
...
@@ -855,6 +862,7 @@ describe Note do
context
'for a noteable'
do
context
'when a comment on the same noteable'
do
subject
{
create
(
:note
)
}
let
(
:note
)
{
create
(
:note
,
in_reply_to:
subject
)
}
it
'returns true'
do
...
...
@@ -864,6 +872,7 @@ describe Note do
context
'when not a comment on the same noteable'
do
subject
{
create
(
:note
)
}
let
(
:note
)
{
create
(
:note
)
}
it
'returns false'
do
...
...
@@ -887,6 +896,7 @@ describe Note do
context
'when not part of a discussion'
do
subject
{
create
(
:note
)
}
let
(
:note
)
{
create
(
:note
,
in_reply_to:
subject
)
}
it
'returns the noteable'
do
...
...
spec/models/pages_domain_spec.rb
View file @
ed0839d1
...
...
@@ -293,11 +293,13 @@ describe PagesDomain do
describe
"#https?"
do
context
"when a certificate is present"
do
subject
{
build
(
:pages_domain
)
}
it
{
is_expected
.
to
be_https
}
end
context
"when no certificate is present"
do
subject
{
build
(
:pages_domain
,
:without_certificate
)
}
it
{
is_expected
.
not_to
be_https
}
end
end
...
...
spec/models/project_spec.rb
View file @
ed0839d1
...
...
@@ -5014,6 +5014,7 @@ describe Project do
describe
'#git_objects_poolable?'
do
subject
{
project
}
context
'when not using hashed storage'
do
let
(
:project
)
{
create
(
:project
,
:legacy_storage
,
:public
,
:repository
)
}
...
...
spec/models/project_wiki_spec.rb
View file @
ed0839d1
...
...
@@ -109,6 +109,7 @@ describe ProjectWiki do
context
"when the wiki repository is empty"
do
describe
'#empty?'
do
subject
{
super
().
empty?
}
it
{
is_expected
.
to
be_truthy
}
end
end
...
...
@@ -121,6 +122,7 @@ describe ProjectWiki do
describe
'#empty?'
do
subject
{
super
().
empty?
}
it
{
is_expected
.
to
be_falsey
}
it
'only instantiates a Wiki page once'
do
...
...
spec/models/resource_label_event_spec.rb
View file @
ed0839d1
...
...
@@ -4,6 +4,7 @@ require 'spec_helper'
RSpec
.
describe
ResourceLabelEvent
,
type: :model
do
subject
{
build
(
:resource_label_event
,
issue:
issue
)
}
let
(
:issue
)
{
create
(
:issue
)
}
let
(
:merge_request
)
{
create
(
:merge_request
)
}
...
...
spec/models/timelog_spec.rb
View file @
ed0839d1
...
...
@@ -4,6 +4,7 @@ require 'spec_helper'
RSpec
.
describe
Timelog
do
subject
{
build
(
:timelog
)
}
let
(
:issue
)
{
create
(
:issue
)
}
let
(
:merge_request
)
{
create
(
:merge_request
)
}
...
...
spec/models/user_interacted_project_spec.rb
View file @
ed0839d1
...
...
@@ -5,6 +5,7 @@ require 'spec_helper'
describe
UserInteractedProject
do
describe
'.track'
do
subject
{
described_class
.
track
(
event
)
}
let
(
:event
)
{
build
(
:event
)
}
Event
::
ACTIONS
.
each
do
|
action
|
...
...
spec/models/user_spec.rb
View file @
ed0839d1
...
...
@@ -2170,6 +2170,7 @@ describe User do
describe
"#contributed_projects"
do
subject
{
create
(
:user
)
}
let!
(
:project1
)
{
create
(
:project
)
}
let!
(
:project2
)
{
fork_project
(
project3
)
}
let!
(
:project3
)
{
create
(
:project
)
}
...
...
spec/policies/identity_provider_policy_spec.rb
View file @
ed0839d1
...
...
@@ -4,6 +4,7 @@ require 'spec_helper'
describe
IdentityProviderPolicy
do
subject
(
:policy
)
{
described_class
.
new
(
user
,
provider
)
}
let
(
:user
)
{
User
.
new
}
let
(
:provider
)
{
:a_provider
}
...
...
spec/policies/merge_request_policy_spec.rb
View file @
ed0839d1
...
...
@@ -53,21 +53,25 @@ describe MergeRequestPolicy do
describe
'the author'
do
subject
{
author
}
it_behaves_like
'a denied user'
end
describe
'a guest'
do
subject
{
guest
}
it_behaves_like
'a denied user'
end
describe
'a developer'
do
subject
{
developer
}
it_behaves_like
'a denied user'
end
describe
'any other user'
do
subject
{
non_team_member
}
it_behaves_like
'a denied user'
end
end
...
...
@@ -82,11 +86,13 @@ describe MergeRequestPolicy do
describe
'a non-team-member'
do
subject
{
non_team_member
}
it_behaves_like
'a denied user'
end
describe
'a developer'
do
subject
{
developer
}
it_behaves_like
'a user with access'
end
end
...
...
spec/presenters/conversational_development_index/metric_presenter_spec.rb
View file @
ed0839d1
...
...
@@ -2,6 +2,7 @@ require 'spec_helper'
describe
ConversationalDevelopmentIndex
::
MetricPresenter
do
subject
{
described_class
.
new
(
metric
)
}
let
(
:metric
)
{
build
(
:conversational_development_index_metric
)
}
describe
'#cards'
do
...
...
spec/requests/api/graphql/namespace/projects_spec.rb
View file @
ed0839d1
...
...
@@ -67,6 +67,7 @@ describe 'getting projects' do
context
'when the namespace is a user'
do
subject
{
user
.
namespace
}
let
(
:include_subgroups
)
{
false
}
it_behaves_like
'a graphql namespace'
...
...
spec/requests/api/pages/internal_access_spec.rb
View file @
ed0839d1
...
...
@@ -27,6 +27,7 @@ describe "Internal Project Pages Access" do
describe
"Project should be internal"
do
describe
'#internal?'
do
subject
{
project
.
internal?
}
it
{
is_expected
.
to
be_truthy
}
end
end
...
...
spec/requests/api/pages/private_access_spec.rb
View file @
ed0839d1
...
...
@@ -27,6 +27,7 @@ describe "Private Project Pages Access" do
describe
"Project should be private"
do
describe
'#private?'
do
subject
{
project
.
private?
}
it
{
is_expected
.
to
be_truthy
}
end
end
...
...
spec/requests/api/pages/public_access_spec.rb
View file @
ed0839d1
...
...
@@ -27,6 +27,7 @@ describe "Public Project Pages Access" do
describe
"Project should be public"
do
describe
'#public?'
do
subject
{
project
.
public?
}
it
{
is_expected
.
to
be_truthy
}
end
end
...
...
spec/rubocop/cop/migration/add_timestamps_spec.rb
View file @
ed0839d1
...
...
@@ -9,6 +9,7 @@ describe RuboCop::Cop::Migration::AddTimestamps do
include
CopHelper
subject
(
:cop
)
{
described_class
.
new
}
let
(
:migration_with_add_timestamps
)
do
%q(
class Users < ActiveRecord::Migration[4.2]
...
...
spec/rubocop/cop/migration/timestamps_spec.rb
View file @
ed0839d1
...
...
@@ -9,6 +9,7 @@ describe RuboCop::Cop::Migration::Timestamps do
include
CopHelper
subject
(
:cop
)
{
described_class
.
new
}
let
(
:migration_with_timestamps
)
do
%q(
class Users < ActiveRecord::Migration[4.2]
...
...
spec/rubocop/cop/scalability/file_uploads_spec.rb
View file @
ed0839d1
...
...
@@ -10,6 +10,7 @@ describe RuboCop::Cop::Scalability::FileUploads do
include
ExpectOffense
subject
(
:cop
)
{
described_class
.
new
}
let
(
:message
)
{
'Do not upload files without workhorse acceleration. Please refer to https://docs.gitlab.com/ee/development/uploads.html'
}
context
'with required params'
do
...
...
spec/serializers/cluster_basic_entity_spec.rb
View file @
ed0839d1
...
...
@@ -5,6 +5,7 @@ require 'spec_helper'
describe
ClusterBasicEntity
do
describe
'#as_json'
do
subject
{
described_class
.
new
(
cluster
,
request:
request
).
as_json
}
let
(
:maintainer
)
{
create
(
:user
)
}
let
(
:developer
)
{
create
(
:user
)
}
let
(
:current_user
)
{
maintainer
}
...
...
spec/serializers/pipeline_serializer_spec.rb
View file @
ed0839d1
...
...
@@ -139,6 +139,7 @@ describe PipelineSerializer do
describe
'number of queries when preloaded'
do
subject
{
serializer
.
represent
(
resource
,
preload:
true
)
}
let
(
:resource
)
{
Ci
::
Pipeline
.
all
}
before
do
...
...
spec/services/git/tag_hooks_service_spec.rb
View file @
ed0839d1
...
...
@@ -58,6 +58,7 @@ describe Git::TagHooksService, :service do
describe
'Push data'
do
shared_examples_for
'tag push data expectations'
do
subject
(
:push_data
)
{
service
.
send
(
:push_data
)
}
it
'has expected push data attributes'
do
is_expected
.
to
match
a_hash_including
(
object_kind:
'tag_push'
,
...
...
spec/services/merge_requests/create_from_issue_service_spec.rb
View file @
ed0839d1
...
...
@@ -13,6 +13,7 @@ describe MergeRequests::CreateFromIssueService do
let
(
:custom_source_branch
)
{
'custom-source-branch'
}
subject
(
:service
)
{
described_class
.
new
(
project
,
user
,
service_params
)
}
subject
(
:service_with_custom_source_branch
)
{
described_class
.
new
(
project
,
user
,
branch_name:
custom_source_branch
,
**
service_params
)
}
before
do
...
...
spec/services/projects/housekeeping_service_spec.rb
View file @
ed0839d1
...
...
@@ -4,6 +4,7 @@ require 'spec_helper'
describe
Projects
::
HousekeepingService
do
subject
{
described_class
.
new
(
project
)
}
set
(
:project
)
{
create
(
:project
,
:repository
)
}
before
do
...
...
spec/support/redis/redis_shared_examples.rb
View file @
ed0839d1
...
...
@@ -90,6 +90,7 @@ RSpec.shared_examples "redis_shared_examples" do
describe
'._raw_config'
do
subject
{
described_class
.
_raw_config
}
let
(
:config_file_name
)
{
'/var/empty/doesnotexist'
}
it
'is frozen'
do
...
...
spec/support/shared_examples/models/cluster_application_status_shared_examples.rb
View file @
ed0839d1
...
...
@@ -111,6 +111,7 @@ shared_examples 'cluster application status specs' do |application_name|
describe
'#make_errored'
do
subject
{
create
(
application_name
,
:installing
)
}
let
(
:reason
)
{
'some errors'
}
it
'is errored'
do
...
...
spec/tasks/gitlab/check_rake_spec.rb
View file @
ed0839d1
...
...
@@ -19,6 +19,7 @@ describe 'check.rake' do
describe
'gitlab:check rake task'
do
subject
{
run_rake_task
(
'gitlab:check'
)
}
let
(
:name
)
{
'GitLab subtasks'
}
it_behaves_like
'system check rake task'
...
...
@@ -26,6 +27,7 @@ describe 'check.rake' do
describe
'gitlab:gitlab_shell:check rake task'
do
subject
{
run_rake_task
(
'gitlab:gitlab_shell:check'
)
}
let
(
:name
)
{
'GitLab Shell'
}
it_behaves_like
'system check rake task'
...
...
@@ -33,6 +35,7 @@ describe 'check.rake' do
describe
'gitlab:gitaly:check rake task'
do
subject
{
run_rake_task
(
'gitlab:gitaly:check'
)
}
let
(
:name
)
{
'Gitaly'
}
it_behaves_like
'system check rake task'
...
...
@@ -40,6 +43,7 @@ describe 'check.rake' do
describe
'gitlab:sidekiq:check rake task'
do
subject
{
run_rake_task
(
'gitlab:sidekiq:check'
)
}
let
(
:name
)
{
'Sidekiq'
}
it_behaves_like
'system check rake task'
...
...
@@ -47,6 +51,7 @@ describe 'check.rake' do
describe
'gitlab:incoming_email:check rake task'
do
subject
{
run_rake_task
(
'gitlab:incoming_email:check'
)
}
let
(
:name
)
{
'Incoming Email'
}
it_behaves_like
'system check rake task'
...
...
@@ -56,6 +61,7 @@ describe 'check.rake' do
include
LdapHelpers
subject
{
run_rake_task
(
'gitlab:ldap:check'
)
}
let
(
:name
)
{
'LDAP'
}
it_behaves_like
'system check rake task'
...
...
spec/workers/hashed_storage/migrator_worker_spec.rb
View file @
ed0839d1
...
...
@@ -4,6 +4,7 @@ require 'spec_helper'
describe
HashedStorage
::
MigratorWorker
do
subject
(
:worker
)
{
described_class
.
new
}
let
(
:projects
)
{
create_list
(
:project
,
2
,
:legacy_storage
,
:empty_repo
)
}
let
(
:ids
)
{
projects
.
map
(
&
:id
)
}
...
...
spec/workers/hashed_storage/rollbacker_worker_spec.rb
View file @
ed0839d1
...
...
@@ -4,6 +4,7 @@ require 'spec_helper'
describe
HashedStorage
::
RollbackerWorker
do
subject
(
:worker
)
{
described_class
.
new
}
let
(
:projects
)
{
create_list
(
:project
,
2
,
:empty_repo
)
}
let
(
:ids
)
{
projects
.
map
(
&
:id
)
}
...
...
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