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
d4ba84a2
Commit
d4ba84a2
authored
May 05, 2020
by
Sean Arnold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add mutation spec and re-word policy spec
parent
98419e98
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
spec/graphql/mutations/alert_management/update_alert_status_spec.rb
...ql/mutations/alert_management/update_alert_status_spec.rb
+2
-0
spec/policies/alert_management/alert_policy_spec.rb
spec/policies/alert_management/alert_policy_spec.rb
+6
-4
No files found.
spec/graphql/mutations/alert_management/update_alert_status_spec.rb
View file @
d4ba84a2
...
...
@@ -9,6 +9,8 @@ describe Mutations::AlertManagement::UpdateAlertStatus do
let
(
:new_status
)
{
'acknowledged'
}
let
(
:args
)
{
{
status:
new_status
,
project_path:
project
.
full_path
,
iid:
alert
.
iid
}
}
specify
{
expect
(
described_class
).
to
require_graphql_authorizations
(
:update_alert_management_alerts
)
}
describe
'#resolve'
do
subject
(
:resolve
)
{
mutation_for
(
project
,
current_user
).
resolve
(
args
)
}
...
...
spec/policies/alert_management/alert_policy_spec.rb
View file @
d4ba84a2
...
...
@@ -6,18 +6,20 @@ describe AlertManagement::AlertPolicy, :models do
let
(
:alert
)
{
create
(
:alert_management_alert
)
}
let
(
:project
)
{
alert
.
project
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:policy
)
{
described_class
.
new
(
user
,
alert
)
}
subject
(
:policy
)
{
described_class
.
new
(
user
,
alert
)
}
describe
'rules'
do
specify
{
expect
(
policy
).
to
be_disallowed
:read_alert_management_alerts
}
it
{
is_expected
.
to
be_disallowed
:read_alert_management_alerts
}
it
{
is_expected
.
to
be_disallowed
:update_alert_management_alerts
}
context
'when developer'
do
before
do
project
.
add_developer
(
user
)
end
specify
{
expect
(
policy
)
.
to
be_allowed
:read_alert_management_alerts
}
specify
{
expect
(
policy
)
.
to
be_allowed
:update_alert_management_alerts
}
it
{
is_expected
.
to
be_allowed
:read_alert_management_alerts
}
it
{
is_expected
.
to
be_allowed
:update_alert_management_alerts
}
end
end
end
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