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
8028d7d4
Commit
8028d7d4
authored
Aug 13, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
5ff943c0
3770f3fb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
spec/policies/clusters/instance_policy_spec.rb
spec/policies/clusters/instance_policy_spec.rb
+4
-0
spec/support/shared_examples/policies/clusterable_shared_examples.rb
...t/shared_examples/policies/clusterable_shared_examples.rb
+8
-0
No files found.
spec/policies/clusters/instance_policy_spec.rb
View file @
8028d7d4
...
...
@@ -9,6 +9,8 @@ describe Clusters::InstancePolicy do
describe
'rules'
do
context
'when user'
do
it
{
expect
(
policy
).
to
be_disallowed
:read_cluster
}
it
{
expect
(
policy
).
to
be_disallowed
:add_cluster
}
it
{
expect
(
policy
).
to
be_disallowed
:create_cluster
}
it
{
expect
(
policy
).
to
be_disallowed
:update_cluster
}
it
{
expect
(
policy
).
to
be_disallowed
:admin_cluster
}
end
...
...
@@ -17,6 +19,8 @@ describe Clusters::InstancePolicy do
let
(
:user
)
{
create
(
:admin
)
}
it
{
expect
(
policy
).
to
be_allowed
:read_cluster
}
it
{
expect
(
policy
).
to
be_allowed
:add_cluster
}
it
{
expect
(
policy
).
to
be_allowed
:create_cluster
}
it
{
expect
(
policy
).
to
be_allowed
:update_cluster
}
it
{
expect
(
policy
).
to
be_allowed
:admin_cluster
}
end
...
...
spec/support/shared_examples/policies/clusterable_shared_examples.rb
View file @
8028d7d4
...
...
@@ -13,7 +13,11 @@ shared_examples 'clusterable policies' do
clusterable
.
add_developer
(
current_user
)
end
it
{
expect_disallowed
(
:read_cluster
)
}
it
{
expect_disallowed
(
:add_cluster
)
}
it
{
expect_disallowed
(
:create_cluster
)
}
it
{
expect_disallowed
(
:update_cluster
)
}
it
{
expect_disallowed
(
:admin_cluster
)
}
end
context
'with a maintainer'
do
...
...
@@ -22,7 +26,11 @@ shared_examples 'clusterable policies' do
end
context
'with no clusters'
do
it
{
expect_allowed
(
:read_cluster
)
}
it
{
expect_allowed
(
:add_cluster
)
}
it
{
expect_allowed
(
:create_cluster
)
}
it
{
expect_allowed
(
:update_cluster
)
}
it
{
expect_allowed
(
:admin_cluster
)
}
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