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
155b3167
Commit
155b3167
authored
Nov 12, 2021
by
Luke Duncalfe
Committed by
Heinrich Lee Yu
Nov 12, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add :group trait for integrations factories
parent
74eb96b4
Changes
18
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
47 additions
and
55 deletions
+47
-55
spec/controllers/groups/settings/integrations_controller_spec.rb
...ntrollers/groups/settings/integrations_controller_spec.rb
+2
-2
spec/controllers/projects/services_controller_spec.rb
spec/controllers/projects/services_controller_spec.rb
+2
-2
spec/factories/integrations.rb
spec/factories/integrations.rb
+5
-0
spec/features/projects/integrations/user_uses_inherited_settings_spec.rb
...rojects/integrations/user_uses_inherited_settings_spec.rb
+1
-1
spec/graphql/types/alert_management/prometheus_integration_type_spec.rb
...ypes/alert_management/prometheus_integration_type_spec.rb
+1
-1
spec/models/concerns/has_integrations_spec.rb
spec/models/concerns/has_integrations_spec.rb
+1
-1
spec/models/group_spec.rb
spec/models/group_spec.rb
+2
-2
spec/models/integration_spec.rb
spec/models/integration_spec.rb
+9
-9
spec/services/admin/propagate_integration_service_spec.rb
spec/services/admin/propagate_integration_service_spec.rb
+2
-2
spec/services/bulk_create_integration_service_spec.rb
spec/services/bulk_create_integration_service_spec.rb
+4
-4
spec/services/bulk_update_integration_service_spec.rb
spec/services/bulk_update_integration_service_spec.rb
+6
-19
spec/services/groups/create_service_spec.rb
spec/services/groups/create_service_spec.rb
+2
-2
spec/services/groups/transfer_service_spec.rb
spec/services/groups/transfer_service_spec.rb
+3
-3
spec/services/projects/create_service_spec.rb
spec/services/projects/create_service_spec.rb
+2
-2
spec/services/projects/transfer_service_spec.rb
spec/services/projects/transfer_service_spec.rb
+1
-1
spec/workers/propagate_integration_group_worker_spec.rb
spec/workers/propagate_integration_group_worker_spec.rb
+1
-1
spec/workers/propagate_integration_inherit_descendant_worker_spec.rb
...s/propagate_integration_inherit_descendant_worker_spec.rb
+2
-2
spec/workers/propagate_integration_project_worker_spec.rb
spec/workers/propagate_integration_project_worker_spec.rb
+1
-1
No files found.
spec/controllers/groups/settings/integrations_controller_spec.rb
View file @
155b3167
...
...
@@ -78,7 +78,7 @@ RSpec.describe Groups::Settings::IntegrationsController do
describe
'#update'
do
include
JiraServiceHelper
let
(
:integration
)
{
create
(
:jira_integration
,
project:
nil
,
group_id:
group
.
id
)
}
let
(
:integration
)
{
create
(
:jira_integration
,
:group
,
group:
group
)
}
before
do
group
.
add_owner
(
user
)
...
...
@@ -108,7 +108,7 @@ RSpec.describe Groups::Settings::IntegrationsController do
end
describe
'#reset'
do
let_it_be
(
:integration
)
{
create
(
:jira_integration
,
group:
group
,
project:
nil
)
}
let_it_be
(
:integration
)
{
create
(
:jira_integration
,
:group
,
group:
group
)
}
let_it_be
(
:inheriting_integration
)
{
create
(
:jira_integration
,
inherit_from_id:
integration
.
id
)
}
subject
do
...
...
spec/controllers/projects/services_controller_spec.rb
View file @
155b3167
...
...
@@ -254,7 +254,7 @@ RSpec.describe Projects::ServicesController do
let_it_be
(
:project
)
{
create
(
:project
,
group:
group
)
}
let_it_be
(
:jira_integration
)
{
create
(
:jira_integration
,
project:
project
)
}
let
(
:group_integration
)
{
create
(
:jira_integration
,
group:
group
,
project:
nil
,
url:
'http://group.com'
,
password:
'group'
)
}
let
(
:group_integration
)
{
create
(
:jira_integration
,
:group
,
group:
group
,
url:
'http://group.com'
,
password:
'group'
)
}
let
(
:integration_params
)
{
{
inherit_from_id:
group_integration
.
id
,
url:
'http://custom.com'
,
password:
'custom'
}
}
it
'ignores submitted params and inherits group settings'
do
...
...
@@ -269,7 +269,7 @@ RSpec.describe Projects::ServicesController do
context
'when param `inherit_from_id` is set to an unrelated group'
do
let_it_be
(
:group
)
{
create
(
:group
)
}
let
(
:group_integration
)
{
create
(
:jira_integration
,
group:
group
,
project:
nil
,
url:
'http://group.com'
,
password:
'group'
)
}
let
(
:group_integration
)
{
create
(
:jira_integration
,
:group
,
group:
group
,
url:
'http://group.com'
,
password:
'group'
)
}
let
(
:integration_params
)
{
{
inherit_from_id:
group_integration
.
id
,
url:
'http://custom.com'
,
password:
'custom'
}
}
it
'ignores the param and saves the submitted settings'
do
...
...
spec/factories/integrations.rb
View file @
155b3167
...
...
@@ -222,6 +222,11 @@ FactoryBot.define do
template
{
true
}
end
trait
:group
do
group
project
{
nil
}
end
trait
:instance
do
project
{
nil
}
instance
{
true
}
...
...
spec/features/projects/integrations/user_uses_inherited_settings_spec.rb
View file @
155b3167
...
...
@@ -84,7 +84,7 @@ RSpec.describe 'User uses inherited settings', :js do
let_it_be
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:project
)
{
create
(
:project
,
group:
group
)
}
let_it_be
(
:parent_settings
)
{
{
url:
'http://group.com'
,
password:
'group'
}
}
let_it_be
(
:parent_integration
)
{
create
(
:jira_integration
,
group:
group
,
project:
nil
,
**
parent_settings
)
}
let_it_be
(
:parent_integration
)
{
create
(
:jira_integration
,
:group
,
group:
group
,
**
parent_settings
)
}
it_behaves_like
'inherited settings'
end
...
...
spec/graphql/types/alert_management/prometheus_integration_type_spec.rb
View file @
155b3167
...
...
@@ -50,7 +50,7 @@ RSpec.describe GitlabSchema.types['AlertManagementPrometheusIntegration'] do
describe
'a group integration'
do
let_it_be
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:integration
)
{
create
(
:prometheus_integration
,
project:
nil
,
group:
group
)
}
let_it_be
(
:integration
)
{
create
(
:prometheus_integration
,
:group
,
group:
group
)
}
# Since it is impossible to authorize the parent here, given that the
# project is nil, all fields should be redacted:
...
...
spec/models/concerns/has_integrations_spec.rb
View file @
155b3167
...
...
@@ -12,7 +12,7 @@ RSpec.describe HasIntegrations do
before
do
create
(
:jira_integration
,
project:
project_1
,
inherit_from_id:
instance_integration
.
id
)
create
(
:jira_integration
,
project:
project_2
,
inherit_from_id:
nil
)
create
(
:jira_integration
,
group:
create
(
:group
),
project:
nil
,
inherit_from_id:
nil
)
create
(
:jira_integration
,
:group
,
group:
create
(
:group
)
,
inherit_from_id:
nil
)
create
(
:jira_integration
,
project:
project_3
,
inherit_from_id:
nil
)
create
(
:integrations_slack
,
project:
project_4
,
inherit_from_id:
nil
)
end
...
...
spec/models/group_spec.rb
View file @
155b3167
...
...
@@ -580,8 +580,8 @@ RSpec.describe Group do
let
(
:instance_integration
)
{
build
(
:jira_integration
,
:instance
)
}
before
do
create
(
:jira_integration
,
group:
group
,
project:
nil
)
create
(
:integrations_slack
,
group:
another_group
,
project:
nil
)
create
(
:jira_integration
,
:group
,
group:
group
)
create
(
:integrations_slack
,
:group
,
group:
another_group
)
end
it
'returns groups without integration'
do
...
...
spec/models/integration_spec.rb
View file @
155b3167
...
...
@@ -299,7 +299,7 @@ RSpec.describe Integration do
end
context
'when integration is a group-level integration'
do
let
(
:group_integration
)
{
create
(
:jira_integration
,
group:
group
,
project:
nil
)
}
let
(
:group_integration
)
{
create
(
:jira_integration
,
:group
,
group:
group
)
}
it
'sets inherit_from_id from integration'
do
integration
=
described_class
.
build_from_integration
(
group_integration
,
project_id:
project
.
id
)
...
...
@@ -458,7 +458,7 @@ RSpec.describe Integration do
end
context
'with an active group-level integration'
do
let!
(
:group_integration
)
{
create
(
:prometheus_integration
,
group:
group
,
project:
nil
,
api_url:
'https://prometheus.group.com/'
)
}
let!
(
:group_integration
)
{
create
(
:prometheus_integration
,
:group
,
group:
group
,
api_url:
'https://prometheus.group.com/'
)
}
it
'creates an integration from the group-level integration'
do
described_class
.
create_from_active_default_integrations
(
project
,
:project_id
)
...
...
@@ -481,7 +481,7 @@ RSpec.describe Integration do
end
context
'with an active subgroup'
do
let!
(
:subgroup_integration
)
{
create
(
:prometheus_integration
,
group:
subgroup
,
project:
nil
,
api_url:
'https://prometheus.subgroup.com/'
)
}
let!
(
:subgroup_integration
)
{
create
(
:prometheus_integration
,
:group
,
group:
subgroup
,
api_url:
'https://prometheus.subgroup.com/'
)
}
let!
(
:subgroup
)
{
create
(
:group
,
parent:
group
)
}
let
(
:project
)
{
create
(
:project
,
group:
subgroup
)
}
...
...
@@ -509,7 +509,7 @@ RSpec.describe Integration do
end
context
'having an integration inheriting settings'
do
let!
(
:subgroup_integration
)
{
create
(
:prometheus_integration
,
group:
subgroup
,
project:
nil
,
inherit_from_id:
group_integration
.
id
,
api_url:
'https://prometheus.subgroup.com/'
)
}
let!
(
:subgroup_integration
)
{
create
(
:prometheus_integration
,
:group
,
group:
subgroup
,
inherit_from_id:
group_integration
.
id
,
api_url:
'https://prometheus.subgroup.com/'
)
}
it
'creates an integration from the group-level integration'
do
described_class
.
create_from_active_default_integrations
(
sub_subgroup
,
:group_id
)
...
...
@@ -552,11 +552,11 @@ RSpec.describe Integration do
let_it_be
(
:subgroup2
)
{
create
(
:group
,
parent:
group
)
}
let_it_be
(
:project1
)
{
create
(
:project
,
group:
subgroup1
)
}
let_it_be
(
:project2
)
{
create
(
:project
,
group:
subgroup2
)
}
let_it_be
(
:group_integration
)
{
create
(
:prometheus_integration
,
group:
group
,
project:
nil
)
}
let_it_be
(
:subgroup_integration1
)
{
create
(
:prometheus_integration
,
group:
subgroup1
,
project:
nil
,
inherit_from_id:
group_integration
.
id
)
}
let_it_be
(
:subgroup_integration2
)
{
create
(
:prometheus_integration
,
group:
subgroup2
,
project:
nil
)
}
let_it_be
(
:project_integration1
)
{
create
(
:prometheus_integration
,
group:
nil
,
project:
project1
,
inherit_from_id:
group_integration
.
id
)
}
let_it_be
(
:project_integration2
)
{
create
(
:prometheus_integration
,
group:
nil
,
project:
project2
,
inherit_from_id:
subgroup_integration2
.
id
)
}
let_it_be
(
:group_integration
)
{
create
(
:prometheus_integration
,
:group
,
group:
group
)
}
let_it_be
(
:subgroup_integration1
)
{
create
(
:prometheus_integration
,
:group
,
group:
subgroup1
,
inherit_from_id:
group_integration
.
id
)
}
let_it_be
(
:subgroup_integration2
)
{
create
(
:prometheus_integration
,
:group
,
group:
subgroup2
)
}
let_it_be
(
:project_integration1
)
{
create
(
:prometheus_integration
,
project:
project1
,
inherit_from_id:
group_integration
.
id
)
}
let_it_be
(
:project_integration2
)
{
create
(
:prometheus_integration
,
project:
project2
,
inherit_from_id:
subgroup_integration2
.
id
)
}
it
'returns the groups and projects inheriting from integration ancestors'
,
:aggregate_failures
do
expect
(
described_class
.
inherited_descendants_from_self_or_ancestors_from
(
group_integration
)).
to
eq
([
subgroup_integration1
,
project_integration1
])
...
...
spec/services/admin/propagate_integration_service_spec.rb
View file @
155b3167
...
...
@@ -55,7 +55,7 @@ RSpec.describe Admin::PropagateIntegrationService do
end
context
'for a group-level integration'
do
let
(
:group_integration
)
{
create
(
:jira_integration
,
group:
group
,
project:
nil
)
}
let
(
:group_integration
)
{
create
(
:jira_integration
,
:group
,
group:
group
)
}
context
'with a project without integration'
do
let
(
:another_project
)
{
create
(
:project
,
group:
group
)
}
...
...
@@ -81,7 +81,7 @@ RSpec.describe Admin::PropagateIntegrationService do
context
'with a subgroup with integration'
do
let
(
:subgroup
)
{
create
(
:group
,
parent:
group
)
}
let
(
:subgroup_integration
)
{
create
(
:jira_integration
,
group:
subgroup
,
project:
nil
,
inherit_from_id:
group_integration
.
id
)
}
let
(
:subgroup_integration
)
{
create
(
:jira_integration
,
:group
,
group:
subgroup
,
inherit_from_id:
group_integration
.
id
)
}
it
'calls to PropagateIntegrationInheritDescendantWorker'
do
expect
(
PropagateIntegrationInheritDescendantWorker
).
to
receive
(
:perform_async
)
...
...
spec/services/bulk_create_integration_service_spec.rb
View file @
155b3167
...
...
@@ -74,7 +74,7 @@ RSpec.describe BulkCreateIntegrationService do
context
'with a project association'
do
let!
(
:project
)
{
create
(
:project
,
group:
group
)
}
let
(
:integration
)
{
create
(
:jira_integration
,
group:
group
,
project:
nil
)
}
let
(
:integration
)
{
create
(
:jira_integration
,
:group
,
group:
group
)
}
let
(
:created_integration
)
{
project
.
jira_integration
}
let
(
:batch
)
{
Project
.
where
(
id:
Project
.
minimum
(
:id
)
..
Project
.
maximum
(
:id
)).
without_integration
(
integration
).
in_namespace
(
integration
.
group
.
self_and_descendants
)
}
let
(
:association
)
{
'project'
}
...
...
@@ -84,7 +84,7 @@ RSpec.describe BulkCreateIntegrationService do
it_behaves_like
'updates inherit_from_id'
context
'with different foreign key of data_fields'
do
let
(
:integration
)
{
create
(
:zentao_integration
,
group:
group
,
project:
nil
)
}
let
(
:integration
)
{
create
(
:zentao_integration
,
:group
,
group:
group
)
}
let
(
:created_integration
)
{
project
.
zentao_integration
}
it_behaves_like
'creates integration from batch ids'
...
...
@@ -94,7 +94,7 @@ RSpec.describe BulkCreateIntegrationService do
context
'with a group association'
do
let!
(
:subgroup
)
{
create
(
:group
,
parent:
group
)
}
let
(
:integration
)
{
create
(
:jira_integration
,
group:
group
,
project:
nil
,
inherit_from_id:
instance_integration
.
id
)
}
let
(
:integration
)
{
create
(
:jira_integration
,
:group
,
group:
group
,
inherit_from_id:
instance_integration
.
id
)
}
let
(
:created_integration
)
{
Integration
.
find_by
(
group:
subgroup
)
}
let
(
:batch
)
{
Group
.
where
(
id:
subgroup
.
id
)
}
let
(
:association
)
{
'group'
}
...
...
@@ -104,7 +104,7 @@ RSpec.describe BulkCreateIntegrationService do
it_behaves_like
'updates inherit_from_id'
context
'with different foreign key of data_fields'
do
let
(
:integration
)
{
create
(
:zentao_integration
,
group:
group
,
project:
nil
,
inherit_from_id:
instance_integration
.
id
)
}
let
(
:integration
)
{
create
(
:zentao_integration
,
:group
,
group:
group
,
inherit_from_id:
instance_integration
.
id
)
}
it_behaves_like
'creates integration from batch ids'
it_behaves_like
'updates inherit_from_id'
...
...
spec/services/bulk_update_integration_service_spec.rb
View file @
155b3167
...
...
@@ -16,32 +16,19 @@ RSpec.describe BulkUpdateIntegrationService do
let_it_be
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:subgroup
)
{
create
(
:group
,
parent:
group
)
}
let_it_be
(
:group_integration
)
do
Integrations
::
Jira
.
create!
(
group:
group
,
url:
'http://group.jira.com'
)
end
let_it_be
(
:group_integration
)
{
create
(
:jira_integration
,
:group
,
group:
group
,
url:
'http://group.jira.com'
)
}
let_it_be
(
:excluded_integration
)
{
create
(
:jira_integration
,
:group
,
group:
create
(
:group
),
url:
'http://another.jira.com'
,
push_events:
false
)
}
let_it_be
(
:subgroup_integration
)
do
Integrations
::
Jira
.
create!
(
inherit_from_id:
group_integration
.
id
,
create
(
:jira_integration
,
:group
,
group:
subgroup
,
inherit_from_id:
group_integration
.
id
,
url:
'http://subgroup.jira.com'
,
push_events:
true
)
end
let_it_be
(
:excluded_integration
)
do
Integrations
::
Jira
.
create!
(
group:
create
(
:group
),
url:
'http://another.jira.com'
,
push_events:
false
)
end
let_it_be
(
:integration
)
do
Integrations
::
Jira
.
create!
(
create
(
:jira_integration
,
project:
create
(
:project
,
group:
subgroup
),
inherit_from_id:
subgroup_integration
.
id
,
url:
'http://project.jira.com'
,
...
...
@@ -92,7 +79,7 @@ RSpec.describe BulkUpdateIntegrationService do
context
'with different foreign key of data_fields'
do
let
(
:integration
)
{
create
(
:zentao_integration
,
project:
create
(
:project
,
group:
group
))
}
let
(
:group_integration
)
do
Integrations
::
Zentao
.
create!
(
create
(
:zentao_integration
,
:group
,
group:
group
,
url:
'https://group.zentao.net'
,
api_token:
'GROUP_TOKEN'
,
...
...
spec/services/groups/create_service_spec.rb
View file @
155b3167
...
...
@@ -171,7 +171,7 @@ RSpec.describe Groups::CreateService, '#execute' do
context
'with an active group-level integration'
do
let
(
:service
)
{
described_class
.
new
(
user
,
group_params
.
merge
(
parent_id:
group
.
id
))
}
let!
(
:group_integration
)
{
create
(
:prometheus_integration
,
group:
group
,
project:
nil
,
api_url:
'https://prometheus.group.com/'
)
}
let!
(
:group_integration
)
{
create
(
:prometheus_integration
,
:group
,
group:
group
,
api_url:
'https://prometheus.group.com/'
)
}
let
(
:group
)
do
create
(
:group
).
tap
do
|
group
|
group
.
add_owner
(
user
)
...
...
@@ -186,7 +186,7 @@ RSpec.describe Groups::CreateService, '#execute' do
context
'with an active subgroup'
do
let
(
:service
)
{
described_class
.
new
(
user
,
group_params
.
merge
(
parent_id:
subgroup
.
id
))
}
let!
(
:subgroup_integration
)
{
create
(
:prometheus_integration
,
group:
subgroup
,
project:
nil
,
api_url:
'https://prometheus.subgroup.com/'
)
}
let!
(
:subgroup_integration
)
{
create
(
:prometheus_integration
,
:group
,
group:
subgroup
,
api_url:
'https://prometheus.subgroup.com/'
)
}
let
(
:subgroup
)
do
create
(
:group
,
parent:
group
).
tap
do
|
subgroup
|
subgroup
.
add_owner
(
user
)
...
...
spec/services/groups/transfer_service_spec.rb
View file @
155b3167
...
...
@@ -279,7 +279,7 @@ RSpec.describe Groups::TransferService, :sidekiq_inline do
context
'when the group is allowed to be transferred'
do
let_it_be
(
:new_parent_group
,
reload:
true
)
{
create
(
:group
,
:public
)
}
let_it_be
(
:new_parent_group_integration
)
{
create
(
:integrations_slack
,
group:
new_parent_group
,
project:
nil
,
webhook:
'http://new-group.slack.com'
)
}
let_it_be
(
:new_parent_group_integration
)
{
create
(
:integrations_slack
,
:group
,
group:
new_parent_group
,
webhook:
'http://new-group.slack.com'
)
}
before
do
allow
(
PropagateIntegrationWorker
).
to
receive
(
:perform_async
)
...
...
@@ -316,7 +316,7 @@ RSpec.describe Groups::TransferService, :sidekiq_inline do
context
'with an inherited integration'
do
let_it_be
(
:instance_integration
)
{
create
(
:integrations_slack
,
:instance
,
webhook:
'http://project.slack.com'
)
}
let_it_be
(
:group_integration
)
{
create
(
:integrations_slack
,
group:
group
,
project:
nil
,
webhook:
'http://group.slack.com'
,
inherit_from_id:
instance_integration
.
id
)
}
let_it_be
(
:group_integration
)
{
create
(
:integrations_slack
,
:group
,
group:
group
,
webhook:
'http://group.slack.com'
,
inherit_from_id:
instance_integration
.
id
)
}
it
'replaces inherited integrations'
,
:aggregate_failures
do
expect
(
new_created_integration
.
webhook
).
to
eq
(
new_parent_group_integration
.
webhook
)
...
...
@@ -326,7 +326,7 @@ RSpec.describe Groups::TransferService, :sidekiq_inline do
end
context
'with a custom integration'
do
let_it_be
(
:group_integration
)
{
create
(
:integrations_slack
,
group:
group
,
project:
nil
,
webhook:
'http://group.slack.com'
)
}
let_it_be
(
:group_integration
)
{
create
(
:integrations_slack
,
:group
,
group:
group
,
webhook:
'http://group.slack.com'
)
}
it
'does not updates the integrations'
,
:aggregate_failures
do
expect
{
transfer_service
.
execute
(
new_parent_group
)
}.
not_to
change
{
group_integration
.
webhook
}
...
...
spec/services/projects/create_service_spec.rb
View file @
155b3167
...
...
@@ -651,7 +651,7 @@ RSpec.describe Projects::CreateService, '#execute' do
end
context
'with an active group-level integration'
do
let!
(
:group_integration
)
{
create
(
:prometheus_integration
,
group:
group
,
project:
nil
,
api_url:
'https://prometheus.group.com/'
)
}
let!
(
:group_integration
)
{
create
(
:prometheus_integration
,
:group
,
group:
group
,
api_url:
'https://prometheus.group.com/'
)
}
let!
(
:group
)
do
create
(
:group
).
tap
do
|
group
|
group
.
add_owner
(
user
)
...
...
@@ -672,7 +672,7 @@ RSpec.describe Projects::CreateService, '#execute' do
end
context
'with an active subgroup'
do
let!
(
:subgroup_integration
)
{
create
(
:prometheus_integration
,
group:
subgroup
,
project:
nil
,
api_url:
'https://prometheus.subgroup.com/'
)
}
let!
(
:subgroup_integration
)
{
create
(
:prometheus_integration
,
:group
,
group:
subgroup
,
api_url:
'https://prometheus.subgroup.com/'
)
}
let!
(
:subgroup
)
do
create
(
:group
,
parent:
group
).
tap
do
|
subgroup
|
subgroup
.
add_owner
(
user
)
...
...
spec/services/projects/transfer_service_spec.rb
View file @
155b3167
...
...
@@ -7,7 +7,7 @@ RSpec.describe Projects::TransferService do
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:group_integration
)
{
create
(
:integrations_slack
,
group:
group
,
project:
nil
,
webhook:
'http://group.slack.com'
)
}
let_it_be
(
:group_integration
)
{
create
(
:integrations_slack
,
:group
,
group:
group
,
webhook:
'http://group.slack.com'
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
:legacy_storage
,
namespace:
user
.
namespace
)
}
...
...
spec/workers/propagate_integration_group_worker_spec.rb
View file @
155b3167
...
...
@@ -22,7 +22,7 @@ RSpec.describe PropagateIntegrationGroupWorker do
end
context
'with a group integration'
do
let_it_be
(
:integration
)
{
create
(
:redmine_integration
,
group:
group
,
project:
nil
)
}
let_it_be
(
:integration
)
{
create
(
:redmine_integration
,
:group
,
group:
group
)
}
it
'calls to BulkCreateIntegrationService'
do
expect
(
BulkCreateIntegrationService
).
to
receive
(
:new
)
...
...
spec/workers/propagate_integration_inherit_descendant_worker_spec.rb
View file @
155b3167
...
...
@@ -5,8 +5,8 @@ require 'spec_helper'
RSpec
.
describe
PropagateIntegrationInheritDescendantWorker
do
let_it_be
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:subgroup
)
{
create
(
:group
,
parent:
group
)
}
let_it_be
(
:group_integration
)
{
create
(
:redmine_integration
,
group:
group
,
project:
nil
)
}
let_it_be
(
:subgroup_integration
)
{
create
(
:redmine_integration
,
group:
subgroup
,
project:
nil
,
inherit_from_id:
group_integration
.
id
)
}
let_it_be
(
:group_integration
)
{
create
(
:redmine_integration
,
:group
,
group:
group
)
}
let_it_be
(
:subgroup_integration
)
{
create
(
:redmine_integration
,
:group
,
group:
subgroup
,
inherit_from_id:
group_integration
.
id
)
}
it_behaves_like
'an idempotent worker'
do
let
(
:job_args
)
{
[
group_integration
.
id
,
subgroup_integration
.
id
,
subgroup_integration
.
id
]
}
...
...
spec/workers/propagate_integration_project_worker_spec.rb
View file @
155b3167
...
...
@@ -22,7 +22,7 @@ RSpec.describe PropagateIntegrationProjectWorker do
end
context
'with a group integration'
do
let_it_be
(
:integration
)
{
create
(
:redmine_integration
,
group:
group
,
project:
nil
)
}
let_it_be
(
:integration
)
{
create
(
:redmine_integration
,
:group
,
group:
group
)
}
it
'calls to BulkCreateIntegrationService'
do
expect
(
BulkCreateIntegrationService
).
to
receive
(
:new
)
...
...
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