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
ad7302e6
Commit
ad7302e6
authored
Jun 04, 2021
by
Nick Thomas
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '228702-fj-improve-wiki-specs' into 'master'
Improve wiki specs See merge request gitlab-org/gitlab!63290
parents
6d6e8e42
4caaaab2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
38 deletions
+48
-38
ee/spec/features/security/project/snippet/private_access_spec.rb
.../features/security/project/snippet/private_access_spec.rb
+2
-3
spec/features/security/project/snippet/private_access_spec.rb
.../features/security/project/snippet/private_access_spec.rb
+46
-35
No files found.
ee/spec/features/security/project/snippet/private_access_spec.rb
View file @
ad7302e6
...
...
@@ -5,9 +5,8 @@ require 'spec_helper'
RSpec
.
describe
"Private Project Snippets Access"
do
include
AccessMatchers
let
(
:project
)
{
create
(
:project
,
:private
)
}
let
(
:private_snippet
)
{
create
(
:project_snippet
,
:private
,
project:
project
,
author:
project
.
owner
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:private
)
}
let_it_be
(
:private_snippet
)
{
create
(
:project_snippet
,
:private
,
project:
project
,
author:
project
.
owner
)
}
describe
"GET /:project_path/snippets"
do
subject
{
project_snippets_path
(
project
)
}
...
...
spec/features/security/project/snippet/private_access_spec.rb
View file @
ad7302e6
...
...
@@ -5,23 +5,25 @@ require 'spec_helper'
RSpec
.
describe
"Private Project Snippets Access"
do
include
AccessMatchers
let
(
:project
)
{
create
(
:project
,
:private
)
}
let
(
:private_snippet
)
{
create
(
:project_snippet
,
:private
,
project:
project
,
author:
project
.
owner
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:private
)
}
let_it_be
(
:private_snippet
)
{
create
(
:project_snippet
,
:private
,
project:
project
,
author:
project
.
owner
)
}
describe
"GET /:project_path/snippets"
do
subject
{
project_snippets_path
(
project
)
}
it
(
'is allowed for admin when admin mode is enabled'
,
:enable_admin_mode
)
{
is_expected
.
to
be_allowed_for
(
:admin
)
}
it
(
'is denied for admin when admin mode is disabled'
)
{
is_expected
.
to
be_denied_for
(
:admin
)
}
it
{
is_expected
.
to
be_allowed_for
(
:owner
).
of
(
project
)
}
it
{
is_expected
.
to
be_allowed_for
(
:maintainer
).
of
(
project
)
}
it
{
is_expected
.
to
be_allowed_for
(
:developer
).
of
(
project
)
}
it
{
is_expected
.
to
be_allowed_for
(
:reporter
).
of
(
project
)
}
it
{
is_expected
.
to
be_allowed_for
(
:guest
).
of
(
project
)
}
it
{
is_expected
.
to
be_denied_for
(
:user
)
}
it
{
is_expected
.
to
be_denied_for
(
:external
)
}
it
{
is_expected
.
to
be_denied_for
(
:visitor
)
}
specify
:aggregate_failures
do
is_expected
.
to
be_allowed_for
(
:owner
).
of
(
project
)
is_expected
.
to
be_allowed_for
(
:maintainer
).
of
(
project
)
is_expected
.
to
be_allowed_for
(
:developer
).
of
(
project
)
is_expected
.
to
be_allowed_for
(
:reporter
).
of
(
project
)
is_expected
.
to
be_allowed_for
(
:guest
).
of
(
project
)
is_expected
.
to
be_denied_for
(
:user
)
is_expected
.
to
be_denied_for
(
:external
)
is_expected
.
to
be_denied_for
(
:visitor
)
end
end
describe
"GET /:project_path/snippets/new"
do
...
...
@@ -29,14 +31,17 @@ RSpec.describe "Private Project Snippets Access" do
it
(
'is allowed for admin when admin mode is enabled'
,
:enable_admin_mode
)
{
is_expected
.
to
be_allowed_for
(
:admin
)
}
it
(
'is denied for admin when admin mode is disabled'
)
{
is_expected
.
to
be_denied_for
(
:admin
)
}
it
{
is_expected
.
to
be_allowed_for
(
:owner
).
of
(
project
)
}
it
{
is_expected
.
to
be_allowed_for
(
:maintainer
).
of
(
project
)
}
it
{
is_expected
.
to
be_allowed_for
(
:developer
).
of
(
project
)
}
it
{
is_expected
.
to
be_allowed_for
(
:reporter
).
of
(
project
)
}
it
{
is_expected
.
to
be_denied_for
(
:guest
).
of
(
project
)
}
it
{
is_expected
.
to
be_denied_for
(
:user
)
}
it
{
is_expected
.
to
be_denied_for
(
:external
)
}
it
{
is_expected
.
to
be_denied_for
(
:visitor
)
}
specify
:aggregate_failures
do
is_expected
.
to
be_allowed_for
(
:maintainer
).
of
(
project
)
is_expected
.
to
be_allowed_for
(
:owner
).
of
(
project
)
is_expected
.
to
be_allowed_for
(
:developer
).
of
(
project
)
is_expected
.
to
be_allowed_for
(
:reporter
).
of
(
project
)
is_expected
.
to
be_denied_for
(
:guest
).
of
(
project
)
is_expected
.
to
be_denied_for
(
:user
)
is_expected
.
to
be_denied_for
(
:external
)
is_expected
.
to
be_denied_for
(
:visitor
)
end
end
describe
"GET /:project_path/snippets/:id for a private snippet"
do
...
...
@@ -44,14 +49,17 @@ RSpec.describe "Private Project Snippets Access" do
it
(
'is allowed for admin when admin mode is enabled'
,
:enable_admin_mode
)
{
is_expected
.
to
be_allowed_for
(
:admin
)
}
it
(
'is denied for admin when admin mode is disabled'
)
{
is_expected
.
to
be_denied_for
(
:admin
)
}
it
{
is_expected
.
to
be_allowed_for
(
:owner
).
of
(
project
)
}
it
{
is_expected
.
to
be_allowed_for
(
:maintainer
).
of
(
project
)
}
it
{
is_expected
.
to
be_allowed_for
(
:developer
).
of
(
project
)
}
it
{
is_expected
.
to
be_allowed_for
(
:reporter
).
of
(
project
)
}
it
{
is_expected
.
to
be_allowed_for
(
:guest
).
of
(
project
)
}
it
{
is_expected
.
to
be_denied_for
(
:user
)
}
it
{
is_expected
.
to
be_denied_for
(
:external
)
}
it
{
is_expected
.
to
be_denied_for
(
:visitor
)
}
specify
:aggregate_failures
do
is_expected
.
to
be_allowed_for
(
:owner
).
of
(
project
)
is_expected
.
to
be_allowed_for
(
:maintainer
).
of
(
project
)
is_expected
.
to
be_allowed_for
(
:developer
).
of
(
project
)
is_expected
.
to
be_allowed_for
(
:reporter
).
of
(
project
)
is_expected
.
to
be_allowed_for
(
:guest
).
of
(
project
)
is_expected
.
to
be_denied_for
(
:user
)
is_expected
.
to
be_denied_for
(
:external
)
is_expected
.
to
be_denied_for
(
:visitor
)
end
end
describe
"GET /:project_path/snippets/:id/raw for a private snippet"
do
...
...
@@ -59,13 +67,16 @@ RSpec.describe "Private Project Snippets Access" do
it
(
'is allowed for admin when admin mode is enabled'
,
:enable_admin_mode
)
{
is_expected
.
to
be_allowed_for
(
:admin
)
}
it
(
'is denied for admin when admin mode is disabled'
)
{
is_expected
.
to
be_denied_for
(
:admin
)
}
it
{
is_expected
.
to
be_allowed_for
(
:owner
).
of
(
project
)
}
it
{
is_expected
.
to
be_allowed_for
(
:maintainer
).
of
(
project
)
}
it
{
is_expected
.
to
be_allowed_for
(
:developer
).
of
(
project
)
}
it
{
is_expected
.
to
be_allowed_for
(
:reporter
).
of
(
project
)
}
it
{
is_expected
.
to
be_allowed_for
(
:guest
).
of
(
project
)
}
it
{
is_expected
.
to
be_denied_for
(
:user
)
}
it
{
is_expected
.
to
be_denied_for
(
:external
)
}
it
{
is_expected
.
to
be_denied_for
(
:visitor
)
}
specify
:aggregate_failures
do
is_expected
.
to
be_allowed_for
(
:owner
).
of
(
project
)
is_expected
.
to
be_allowed_for
(
:maintainer
).
of
(
project
)
is_expected
.
to
be_allowed_for
(
:developer
).
of
(
project
)
is_expected
.
to
be_allowed_for
(
:reporter
).
of
(
project
)
is_expected
.
to
be_allowed_for
(
:guest
).
of
(
project
)
is_expected
.
to
be_denied_for
(
:user
)
is_expected
.
to
be_denied_for
(
:external
)
is_expected
.
to
be_denied_for
(
:visitor
)
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