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
3be85a53
Commit
3be85a53
authored
Jan 07, 2020
by
Vitali Tatarintev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace set with let_it_be
Contributes to
https://gitlab.com/gitlab-org/gitlab/issues/27922
parent
249e94f7
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
32 additions
and
32 deletions
+32
-32
ee/spec/services/projects/after_rename_service_spec.rb
ee/spec/services/projects/after_rename_service_spec.rb
+2
-2
ee/spec/services/projects/alerting/notify_service_spec.rb
ee/spec/services/projects/alerting/notify_service_spec.rb
+2
-2
ee/spec/services/projects/create_service_spec.rb
ee/spec/services/projects/create_service_spec.rb
+2
-2
ee/spec/services/projects/destroy_service_spec.rb
ee/spec/services/projects/destroy_service_spec.rb
+2
-2
ee/spec/services/projects/gitlab_projects_import_service_spec.rb
.../services/projects/gitlab_projects_import_service_spec.rb
+1
-1
ee/spec/services/projects/hashed_storage/migrate_attachments_service_spec.rb
...ojects/hashed_storage/migrate_attachments_service_spec.rb
+2
-2
ee/spec/services/projects/import_export/export_service_spec.rb
...ec/services/projects/import_export/export_service_spec.rb
+2
-2
ee/spec/services/projects/operations/update_service_spec.rb
ee/spec/services/projects/operations/update_service_spec.rb
+1
-1
ee/spec/services/projects/prometheus/alerts/create_events_service_spec.rb
.../projects/prometheus/alerts/create_events_service_spec.rb
+1
-1
ee/spec/services/projects/prometheus/alerts/create_service_spec.rb
...ervices/projects/prometheus/alerts/create_service_spec.rb
+4
-4
ee/spec/services/projects/prometheus/alerts/destroy_service_spec.rb
...rvices/projects/prometheus/alerts/destroy_service_spec.rb
+3
-3
ee/spec/services/projects/prometheus/alerts/notify_service_spec.rb
...ervices/projects/prometheus/alerts/notify_service_spec.rb
+2
-2
ee/spec/services/projects/prometheus/alerts/update_service_spec.rb
...ervices/projects/prometheus/alerts/update_service_spec.rb
+4
-4
ee/spec/services/projects/transfer_service_spec.rb
ee/spec/services/projects/transfer_service_spec.rb
+2
-2
ee/spec/services/projects/update_service_spec.rb
ee/spec/services/projects/update_service_spec.rb
+2
-2
No files found.
ee/spec/services/projects/after_rename_service_spec.rb
View file @
3be85a53
...
...
@@ -7,8 +7,8 @@ describe Projects::AfterRenameService do
describe
'#execute'
do
context
'when running on a primary node'
do
set
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
set
(
:secondary
)
{
create
(
:geo_node
)
}
let_it_be
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
let_it_be
(
:secondary
)
{
create
(
:geo_node
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
:legacy_storage
)
}
let!
(
:path_before_rename
)
{
project
.
path
}
let!
(
:full_path_before_rename
)
{
project
.
full_path
}
...
...
ee/spec/services/projects/alerting/notify_service_spec.rb
View file @
3be85a53
...
...
@@ -3,10 +3,10 @@
require
'spec_helper'
describe
Projects
::
Alerting
::
NotifyService
do
set
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:project
,
reload:
true
)
{
create
(
:project
)
}
before
do
# We use `
set
(:project)` so we make sure to clear caches
# We use `
let_it_be
(:project)` so we make sure to clear caches
project
.
clear_memoization
(
:licensed_feature_available
)
end
...
...
ee/spec/services/projects/create_service_spec.rb
View file @
3be85a53
...
...
@@ -212,8 +212,8 @@ describe Projects::CreateService, '#execute' do
end
context
'when running on a primary node'
do
set
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
set
(
:secondary
)
{
create
(
:geo_node
)
}
let_it_be
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
let_it_be
(
:secondary
)
{
create
(
:geo_node
)
}
before
do
stub_current_geo_node
(
primary
)
...
...
ee/spec/services/projects/destroy_service_spec.rb
View file @
3be85a53
...
...
@@ -34,8 +34,8 @@ describe Projects::DestroyService do
end
context
'when running on a primary node'
do
set
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
set
(
:secondary
)
{
create
(
:geo_node
)
}
let_it_be
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
let_it_be
(
:secondary
)
{
create
(
:geo_node
)
}
before
do
stub_current_geo_node
(
primary
)
...
...
ee/spec/services/projects/gitlab_projects_import_service_spec.rb
View file @
3be85a53
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
describe
Projects
::
GitlabProjectsImportService
do
set
(
:namespace
)
{
create
(
:namespace
)
}
let_it_be
(
:namespace
)
{
create
(
:namespace
)
}
let
(
:path
)
{
'test-path'
}
let
(
:custom_template
)
{
create
(
:project
)
}
let
(
:overwrite
)
{
false
}
...
...
ee/spec/services/projects/hashed_storage/migrate_attachments_service_spec.rb
View file @
3be85a53
...
...
@@ -11,8 +11,8 @@ describe Projects::HashedStorage::MigrateAttachmentsService do
let
(
:old_attachments_path
)
{
legacy_storage
.
disk_path
}
let
(
:new_attachments_path
)
{
hashed_storage
.
disk_path
}
set
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
set
(
:secondary
)
{
create
(
:geo_node
)
}
let_it_be
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
let_it_be
(
:secondary
)
{
create
(
:geo_node
)
}
subject
{
described_class
.
new
(
project:
project
,
old_disk_path:
old_attachments_path
)
}
...
...
ee/spec/services/projects/import_export/export_service_spec.rb
View file @
3be85a53
...
...
@@ -4,8 +4,8 @@ require 'spec_helper'
describe
Projects
::
ImportExport
::
ExportService
do
describe
'#execute'
do
set
(
:user
)
{
create
(
:user
)
}
set
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let
(
:shared
)
{
project
.
import_export_shared
}
let
(
:service
)
{
described_class
.
new
(
project
,
user
)
}
let!
(
:after_export_strategy
)
{
Gitlab
::
ImportExport
::
AfterExportStrategies
::
DownloadNotificationStrategy
.
new
}
...
...
ee/spec/services/projects/operations/update_service_spec.rb
View file @
3be85a53
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
describe
Projects
::
Operations
::
UpdateService
do
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:result
)
{
subject
.
execute
}
...
...
ee/spec/services/projects/prometheus/alerts/create_events_service_spec.rb
View file @
3be85a53
...
...
@@ -4,7 +4,7 @@ require 'spec_helper'
describe
Projects
::
Prometheus
::
Alerts
::
CreateEventsService
do
let
(
:user
)
{
create
(
:user
)
}
set
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let
(
:metric
)
{
create
(
:prometheus_metric
,
project:
project
)
}
let
(
:service
)
{
described_class
.
new
(
project
,
user
,
alerts_payload
)
}
...
...
ee/spec/services/projects/prometheus/alerts/create_service_spec.rb
View file @
3be85a53
...
...
@@ -3,8 +3,8 @@
require
'spec_helper'
describe
Projects
::
Prometheus
::
Alerts
::
CreateService
do
set
(
:project
)
{
create
(
:project
)
}
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let
(
:service
)
{
described_class
.
new
(
project
,
user
,
params
)
}
...
...
@@ -12,9 +12,9 @@ describe Projects::Prometheus::Alerts::CreateService do
describe
'#execute'
do
context
'with params'
do
set
(
:environment
)
{
create
(
:environment
,
project:
project
)
}
let_it_be
(
:environment
)
{
create
(
:environment
,
project:
project
)
}
set
(
:metric
)
do
let_it_be
(
:metric
)
do
create
(
:prometheus_metric
,
project:
project
)
end
...
...
ee/spec/services/projects/prometheus/alerts/destroy_service_spec.rb
View file @
3be85a53
...
...
@@ -3,9 +3,9 @@
require
'spec_helper'
describe
Projects
::
Prometheus
::
Alerts
::
DestroyService
do
set
(
:project
)
{
create
(
:project
)
}
set
(
:user
)
{
create
(
:user
)
}
set
(
:alert
)
{
create
(
:prometheus_alert
,
project:
project
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:alert
)
{
create
(
:prometheus_alert
,
project:
project
)
}
let
(
:service
)
{
described_class
.
new
(
project
,
user
,
nil
)
}
...
...
ee/spec/services/projects/prometheus/alerts/notify_service_spec.rb
View file @
3be85a53
...
...
@@ -3,14 +3,14 @@
require
'spec_helper'
describe
Projects
::
Prometheus
::
Alerts
::
NotifyService
do
set
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:project
,
reload:
true
)
{
create
(
:project
)
}
let
(
:service
)
{
described_class
.
new
(
project
,
nil
,
payload
)
}
let
(
:token_input
)
{
'token'
}
let
(
:subject
)
{
service
.
execute
(
token_input
)
}
before
do
# We use `
set
(:project)` so we make sure to clear caches
# We use `
let_it_be
(:project)` so we make sure to clear caches
project
.
clear_memoization
(
:licensed_feature_available
)
end
...
...
ee/spec/services/projects/prometheus/alerts/update_service_spec.rb
View file @
3be85a53
...
...
@@ -3,11 +3,11 @@
require
'spec_helper'
describe
Projects
::
Prometheus
::
Alerts
::
UpdateService
do
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
)
}
set
(
:alert
)
do
let_it_be
(
:alert
)
do
create
(
:prometheus_alert
,
project:
project
,
environment:
environment
)
end
...
...
ee/spec/services/projects/transfer_service_spec.rb
View file @
3be85a53
...
...
@@ -16,8 +16,8 @@ describe Projects::TransferService do
end
context
'when running on a primary node'
do
set
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
set
(
:secondary
)
{
create
(
:geo_node
)
}
let_it_be
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
let_it_be
(
:secondary
)
{
create
(
:geo_node
)
}
it
'logs an event to the Geo event log'
do
stub_current_geo_node
(
primary
)
...
...
ee/spec/services/projects/update_service_spec.rb
View file @
3be85a53
...
...
@@ -110,8 +110,8 @@ describe Projects::UpdateService, '#execute' do
context
'triggering wiki Geo syncs'
,
:geo
do
context
'on a Geo primary'
do
set
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
set
(
:secondary
)
{
create
(
:geo_node
)
}
let_it_be
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
let_it_be
(
:secondary
)
{
create
(
:geo_node
)
}
before
do
stub_current_geo_node
(
primary
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment