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
63fa46cd
Commit
63fa46cd
authored
Dec 04, 2020
by
Sean Arnold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor stylistic tweaks
parent
c89fb511
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
10 deletions
+9
-10
ee/app/services/incident_management/oncall_rotations/create_service.rb
...es/incident_management/oncall_rotations/create_service.rb
+4
-5
ee/spec/policies/incident_management/oncall_rotation_policy_spec.rb
...licies/incident_management/oncall_rotation_policy_spec.rb
+5
-4
ee/spec/services/incident_management/oncall_rotations/create_service_spec.rb
...cident_management/oncall_rotations/create_service_spec.rb
+0
-1
No files found.
ee/app/services/incident_management/oncall_rotations/create_service.rb
View file @
63fa46cd
...
@@ -5,7 +5,7 @@ module IncidentManagement
...
@@ -5,7 +5,7 @@ module IncidentManagement
class
CreateService
class
CreateService
# @param schedule [IncidentManagement::OncallSchedule]
# @param schedule [IncidentManagement::OncallSchedule]
# @param project [Project]
# @param project [Project]
# @param user [User]
# @param
current_
user [User]
# @param params [Hash<Symbol,Any>]
# @param params [Hash<Symbol,Any>]
# @param params - name [String] The name of the on-call rotation.
# @param params - name [String] The name of the on-call rotation.
# @param params - length [Integer] The length of the rotation.
# @param params - length [Integer] The length of the rotation.
...
@@ -15,10 +15,10 @@ module IncidentManagement
...
@@ -15,10 +15,10 @@ module IncidentManagement
# @option opts - participant [User] The user who is part of the rotation
# @option opts - participant [User] The user who is part of the rotation
# @option opts - color_palette [String] The color palette to assign to the on-call user, for example: "blue".
# @option opts - color_palette [String] The color palette to assign to the on-call user, for example: "blue".
# @option opts - color_weight [String] The color weight to assign to for the on-call user, for example "500". Max 4 chars.
# @option opts - color_weight [String] The color weight to assign to for the on-call user, for example "500". Max 4 chars.
def
initialize
(
schedule
,
project
,
user
,
params
)
def
initialize
(
schedule
,
project
,
current_
user
,
params
)
@schedule
=
schedule
@schedule
=
schedule
@project
=
project
@project
=
project
@current_user
=
user
@current_user
=
current_
user
@params
=
params
@params
=
params
end
end
...
@@ -53,8 +53,7 @@ module IncidentManagement
...
@@ -53,8 +53,7 @@ module IncidentManagement
end
end
def
available?
def
available?
Feature
.
enabled?
(
:oncall_schedules_mvc
,
project
)
&&
::
Gitlab
::
IncidentManagement
.
oncall_schedules_available?
(
project
)
project
.
feature_available?
(
:oncall_schedules
)
end
end
def
error
(
message
)
def
error
(
message
)
...
...
ee/spec/policies/incident_management/oncall_rotation_policy_spec.rb
View file @
63fa46cd
...
@@ -12,6 +12,7 @@ RSpec.describe IncidentManagement::OncallRotationPolicy do
...
@@ -12,6 +12,7 @@ RSpec.describe IncidentManagement::OncallRotationPolicy do
before
do
before
do
stub_feature_flags
(
oncall_schedules_mvc:
project
)
stub_feature_flags
(
oncall_schedules_mvc:
project
)
stub_licensed_features
(
oncall_schedules:
true
)
end
end
describe
'rules'
do
describe
'rules'
do
...
@@ -22,14 +23,14 @@ RSpec.describe IncidentManagement::OncallRotationPolicy do
...
@@ -22,14 +23,14 @@ RSpec.describe IncidentManagement::OncallRotationPolicy do
project
.
add_reporter
(
user
)
project
.
add_reporter
(
user
)
end
end
it
{
is_expected
.
to
be_
dis
allowed
:read_incident_management_oncall_schedule
}
it
{
is_expected
.
to
be_allowed
:read_incident_management_oncall_schedule
}
context
'licensed feature
en
abled'
do
context
'licensed feature
dis
abled'
do
before
do
before
do
stub_licensed_features
(
oncall_schedules:
tru
e
)
stub_licensed_features
(
oncall_schedules:
fals
e
)
end
end
it
{
is_expected
.
to
be_allowed
:read_incident_management_oncall_schedule
}
it
{
is_expected
.
to
be_
dis
allowed
:read_incident_management_oncall_schedule
}
end
end
end
end
end
end
...
...
ee/spec/services/incident_management/oncall_rotations/create_service_spec.rb
View file @
63fa46cd
...
@@ -5,7 +5,6 @@ require 'spec_helper'
...
@@ -5,7 +5,6 @@ require 'spec_helper'
RSpec
.
describe
IncidentManagement
::
OncallRotations
::
CreateService
do
RSpec
.
describe
IncidentManagement
::
OncallRotations
::
CreateService
do
let_it_be_with_refind
(
:project
)
{
create
(
:project
)
}
let_it_be_with_refind
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:schedule
)
{
create
(
:incident_management_oncall_schedule
,
project:
project
)
}
let_it_be
(
:schedule
)
{
create
(
:incident_management_oncall_schedule
,
project:
project
)
}
let_it_be
(
:user_with_permissions
)
{
create
(
:user
)
}
let_it_be
(
:user_with_permissions
)
{
create
(
:user
)
}
let_it_be
(
:user_without_permissions
)
{
create
(
:user
)
}
let_it_be
(
:user_without_permissions
)
{
create
(
:user
)
}
let_it_be
(
:current_user
)
{
user_with_permissions
}
let_it_be
(
:current_user
)
{
user_with_permissions
}
...
...
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