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
9e449d2e
Commit
9e449d2e
authored
May 24, 2019
by
Małgorzata Ksionek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move ee parts to ee directory - project snippet public and private specs
parent
43280c18
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
96 additions
and
12 deletions
+96
-12
ee/spec/features/security/project/snippet/private_access_spec.rb
.../features/security/project/snippet/private_access_spec.rb
+33
-0
ee/spec/features/security/project/snippet/public_access_spec.rb
...c/features/security/project/snippet/public_access_spec.rb
+63
-0
spec/features/security/project/snippet/private_access_spec.rb
.../features/security/project/snippet/private_access_spec.rb
+0
-4
spec/features/security/project/snippet/public_access_spec.rb
spec/features/security/project/snippet/public_access_spec.rb
+0
-8
No files found.
ee/spec/features/security/project/snippet/private_access_spec.rb
0 → 100644
View file @
9e449d2e
require
'spec_helper'
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
)
}
describe
"GET /:project_path/snippets"
do
subject
{
project_snippets_path
(
project
)
}
it
{
is_expected
.
to
be_allowed_for
(
:auditor
)
}
end
describe
"GET /:project_path/snippets/new"
do
subject
{
new_project_snippet_path
(
project
)
}
it
{
is_expected
.
to
be_denied_for
(
:auditor
)
}
end
describe
"GET /:project_path/snippets/:id for a private snippet"
do
subject
{
project_snippet_path
(
project
,
private_snippet
)
}
it
{
is_expected
.
to
be_allowed_for
(
:auditor
)
}
end
describe
"GET /:project_path/snippets/:id/raw for a private snippet"
do
subject
{
raw_project_snippet_path
(
project
,
private_snippet
)
}
it
{
is_expected
.
to
be_allowed_for
(
:auditor
)
}
end
end
ee/spec/features/security/project/snippet/public_access_spec.rb
0 → 100644
View file @
9e449d2e
require
'spec_helper'
describe
"Public Project Snippets Access"
do
include
AccessMatchers
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:public_snippet
)
{
create
(
:project_snippet
,
:public
,
project:
project
,
author:
project
.
owner
)
}
let
(
:internal_snippet
)
{
create
(
:project_snippet
,
:internal
,
project:
project
,
author:
project
.
owner
)
}
let
(
:private_snippet
)
{
create
(
:project_snippet
,
:private
,
project:
project
,
author:
project
.
owner
)
}
describe
"GET /:project_path/snippets"
do
subject
{
project_snippets_path
(
project
)
}
it
{
is_expected
.
to
be_allowed_for
(
:auditor
)
}
end
describe
"GET /:project_path/snippets/new"
do
subject
{
new_project_snippet_path
(
project
)
}
it
{
is_expected
.
to
be_denied_for
(
:auditor
)
}
end
describe
"GET /:project_path/snippets/:id"
do
context
"for a public snippet"
do
subject
{
project_snippet_path
(
project
,
public_snippet
)
}
it
{
is_expected
.
to
be_allowed_for
(
:auditor
)
}
end
context
"for an internal snippet"
do
subject
{
project_snippet_path
(
project
,
internal_snippet
)
}
it
{
is_expected
.
to
be_allowed_for
(
:auditor
)
}
end
context
"for a private snippet"
do
subject
{
project_snippet_path
(
project
,
private_snippet
)
}
it
{
is_expected
.
to
be_allowed_for
(
:auditor
)
}
end
end
describe
"GET /:project_path/snippets/:id/raw"
do
context
"for a public snippet"
do
subject
{
raw_project_snippet_path
(
project
,
public_snippet
)
}
it
{
is_expected
.
to
be_allowed_for
(
:auditor
)
}
end
context
"for an internal snippet"
do
subject
{
raw_project_snippet_path
(
project
,
internal_snippet
)
}
it
{
is_expected
.
to
be_allowed_for
(
:auditor
)
}
end
context
"for a private snippet"
do
subject
{
raw_project_snippet_path
(
project
,
private_snippet
)
}
it
{
is_expected
.
to
be_allowed_for
(
:auditor
)
}
end
end
end
spec/features/security/project/snippet/private_access_spec.rb
View file @
9e449d2e
...
...
@@ -11,7 +11,6 @@ describe "Private Project Snippets Access" do
subject
{
project_snippets_path
(
project
)
}
it
{
is_expected
.
to
be_allowed_for
(
:admin
)
}
it
{
is_expected
.
to
be_allowed_for
(
:auditor
)
}
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
)
}
...
...
@@ -26,7 +25,6 @@ describe "Private Project Snippets Access" do
subject
{
new_project_snippet_path
(
project
)
}
it
{
is_expected
.
to
be_allowed_for
(
:admin
)
}
it
{
is_expected
.
to
be_denied_for
(
:auditor
)
}
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
)
}
...
...
@@ -41,7 +39,6 @@ describe "Private Project Snippets Access" do
subject
{
project_snippet_path
(
project
,
private_snippet
)
}
it
{
is_expected
.
to
be_allowed_for
(
:admin
)
}
it
{
is_expected
.
to
be_allowed_for
(
:auditor
)
}
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
)
}
...
...
@@ -56,7 +53,6 @@ describe "Private Project Snippets Access" do
subject
{
raw_project_snippet_path
(
project
,
private_snippet
)
}
it
{
is_expected
.
to
be_allowed_for
(
:admin
)
}
it
{
is_expected
.
to
be_allowed_for
(
:auditor
)
}
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
)
}
...
...
spec/features/security/project/snippet/public_access_spec.rb
View file @
9e449d2e
...
...
@@ -13,7 +13,6 @@ describe "Public Project Snippets Access" do
subject
{
project_snippets_path
(
project
)
}
it
{
is_expected
.
to
be_allowed_for
(
:admin
)
}
it
{
is_expected
.
to
be_allowed_for
(
:auditor
)
}
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
)
}
...
...
@@ -28,7 +27,6 @@ describe "Public Project Snippets Access" do
subject
{
new_project_snippet_path
(
project
)
}
it
{
is_expected
.
to
be_allowed_for
(
:admin
)
}
it
{
is_expected
.
to
be_denied_for
(
:auditor
)
}
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
)
}
...
...
@@ -44,7 +42,6 @@ describe "Public Project Snippets Access" do
subject
{
project_snippet_path
(
project
,
public_snippet
)
}
it
{
is_expected
.
to
be_allowed_for
(
:admin
)
}
it
{
is_expected
.
to
be_allowed_for
(
:auditor
)
}
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
)
}
...
...
@@ -59,7 +56,6 @@ describe "Public Project Snippets Access" do
subject
{
project_snippet_path
(
project
,
internal_snippet
)
}
it
{
is_expected
.
to
be_allowed_for
(
:admin
)
}
it
{
is_expected
.
to
be_allowed_for
(
:auditor
)
}
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
)
}
...
...
@@ -74,7 +70,6 @@ describe "Public Project Snippets Access" do
subject
{
project_snippet_path
(
project
,
private_snippet
)
}
it
{
is_expected
.
to
be_allowed_for
(
:admin
)
}
it
{
is_expected
.
to
be_allowed_for
(
:auditor
)
}
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
)
}
...
...
@@ -91,7 +86,6 @@ describe "Public Project Snippets Access" do
subject
{
raw_project_snippet_path
(
project
,
public_snippet
)
}
it
{
is_expected
.
to
be_allowed_for
(
:admin
)
}
it
{
is_expected
.
to
be_allowed_for
(
:auditor
)
}
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
)
}
...
...
@@ -106,7 +100,6 @@ describe "Public Project Snippets Access" do
subject
{
raw_project_snippet_path
(
project
,
internal_snippet
)
}
it
{
is_expected
.
to
be_allowed_for
(
:admin
)
}
it
{
is_expected
.
to
be_allowed_for
(
:auditor
)
}
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
)
}
...
...
@@ -121,7 +114,6 @@ describe "Public Project Snippets Access" do
subject
{
raw_project_snippet_path
(
project
,
private_snippet
)
}
it
{
is_expected
.
to
be_allowed_for
(
:admin
)
}
it
{
is_expected
.
to
be_allowed_for
(
:auditor
)
}
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
)
}
...
...
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