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
98419e98
Commit
98419e98
authored
May 05, 2020
by
Sean Arnold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update spec style and add policy spec
parent
dbb412f7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
spec/graphql/mutations/alert_management/update_alert_status_spec.rb
...ql/mutations/alert_management/update_alert_status_spec.rb
+2
-2
spec/policies/alert_management/alert_policy_spec.rb
spec/policies/alert_management/alert_policy_spec.rb
+3
-2
No files found.
spec/graphql/mutations/alert_management/update_alert_status_spec.rb
View file @
98419e98
...
...
@@ -35,8 +35,8 @@ describe Mutations::AlertManagement::UpdateAlertStatus do
allow
(
resolver
).
to
receive
(
:resolve
).
and_return
(
alert
)
end
expect
(
alert
).
to
receive
(
:save
).
and_return
(
false
)
expect
(
alert
).
to
receive
(
:errors
).
and_return
(
allow
(
alert
).
to
receive
(
:save
).
and_return
(
false
)
allow
(
alert
).
to
receive
(
:errors
).
and_return
(
double
(
full_messages:
%w(foo bar)
)
)
expect
(
resolve
).
to
eq
(
...
...
spec/policies/alert_management/alert_policy_spec.rb
View file @
98419e98
...
...
@@ -9,14 +9,15 @@ describe AlertManagement::AlertPolicy, :models do
let
(
:policy
)
{
described_class
.
new
(
user
,
alert
)
}
describe
'rules'
do
it
{
expect
(
policy
).
to
be_disallowed
:read_alert_management_alerts
}
specify
{
expect
(
policy
).
to
be_disallowed
:read_alert_management_alerts
}
context
'when developer'
do
before
do
project
.
add_developer
(
user
)
end
it
{
expect
(
policy
).
to
be_allowed
:read_alert_management_alerts
}
specify
{
expect
(
policy
).
to
be_allowed
:read_alert_management_alerts
}
specify
{
expect
(
policy
).
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