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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
b24d5f13
Commit
b24d5f13
authored
Jul 16, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Consolidate group access specs into one file
parent
0d5cf111
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
284 additions
and
353 deletions
+284
-353
spec/features/security/group/group_access_spec.rb
spec/features/security/group/group_access_spec.rb
+0
-100
spec/features/security/group/internal_group_access_spec.rb
spec/features/security/group/internal_group_access_spec.rb
+0
-84
spec/features/security/group/mixed_group_access_spec.rb
spec/features/security/group/mixed_group_access_spec.rb
+0
-85
spec/features/security/group/public_group_access_spec.rb
spec/features/security/group/public_group_access_spec.rb
+0
-84
spec/features/security/group_access_spec.rb
spec/features/security/group_access_spec.rb
+284
-0
No files found.
spec/features/security/group/group_access_spec.rb
deleted
100644 → 0
View file @
0d5cf111
require
'spec_helper'
describe
"Group access"
,
feature:
true
do
include
AccessMatchers
describe
"GET /projects/new"
do
it
{
expect
(
new_group_path
).
to
be_allowed_for
:admin
}
it
{
expect
(
new_group_path
).
to
be_allowed_for
:user
}
it
{
expect
(
new_group_path
).
to
be_denied_for
:visitor
}
end
describe
"Group"
do
let
(
:group
)
{
create
(
:group
)
}
let
(
:owner
)
{
create
(
:owner
)
}
let
(
:master
)
{
create
(
:user
)
}
let
(
:reporter
)
{
create
(
:user
)
}
let
(
:guest
)
{
create
(
:user
)
}
let
(
:nonmember
)
{
create
(
:user
)
}
before
do
group
.
add_user
(
owner
,
Gitlab
::
Access
::
OWNER
)
group
.
add_user
(
master
,
Gitlab
::
Access
::
MASTER
)
group
.
add_user
(
reporter
,
Gitlab
::
Access
::
REPORTER
)
group
.
add_user
(
guest
,
Gitlab
::
Access
::
GUEST
)
end
describe
"GET /groups/:path"
do
subject
{
group_path
(
group
)
}
it
{
is_expected
.
to
be_allowed_for
owner
}
it
{
is_expected
.
to
be_allowed_for
master
}
it
{
is_expected
.
to
be_allowed_for
reporter
}
it
{
is_expected
.
to
be_allowed_for
:admin
}
it
{
is_expected
.
to
be_allowed_for
guest
}
it
{
is_expected
.
to
be_denied_for
:user
}
it
{
is_expected
.
to
be_denied_for
:visitor
}
end
describe
"GET /groups/:path/issues"
do
subject
{
issues_group_path
(
group
)
}
it
{
is_expected
.
to
be_allowed_for
owner
}
it
{
is_expected
.
to
be_allowed_for
master
}
it
{
is_expected
.
to
be_allowed_for
reporter
}
it
{
is_expected
.
to
be_allowed_for
:admin
}
it
{
is_expected
.
to
be_allowed_for
guest
}
it
{
is_expected
.
to
be_denied_for
:user
}
it
{
is_expected
.
to
be_denied_for
:visitor
}
end
describe
"GET /groups/:path/merge_requests"
do
subject
{
merge_requests_group_path
(
group
)
}
it
{
is_expected
.
to
be_allowed_for
owner
}
it
{
is_expected
.
to
be_allowed_for
master
}
it
{
is_expected
.
to
be_allowed_for
reporter
}
it
{
is_expected
.
to
be_allowed_for
:admin
}
it
{
is_expected
.
to
be_allowed_for
guest
}
it
{
is_expected
.
to
be_denied_for
:user
}
it
{
is_expected
.
to
be_denied_for
:visitor
}
end
describe
"GET /groups/:path/group_members"
do
subject
{
group_group_members_path
(
group
)
}
it
{
is_expected
.
to
be_allowed_for
owner
}
it
{
is_expected
.
to
be_allowed_for
master
}
it
{
is_expected
.
to
be_allowed_for
reporter
}
it
{
is_expected
.
to
be_allowed_for
:admin
}
it
{
is_expected
.
to
be_allowed_for
guest
}
it
{
is_expected
.
to
be_denied_for
:user
}
it
{
is_expected
.
to
be_denied_for
:visitor
}
end
describe
"GET /groups/:path/edit"
do
subject
{
edit_group_path
(
group
)
}
it
{
is_expected
.
to
be_allowed_for
owner
}
it
{
is_expected
.
to
be_denied_for
master
}
it
{
is_expected
.
to
be_denied_for
reporter
}
it
{
is_expected
.
to
be_allowed_for
:admin
}
it
{
is_expected
.
to
be_denied_for
guest
}
it
{
is_expected
.
to
be_denied_for
:user
}
it
{
is_expected
.
to
be_denied_for
:visitor
}
end
describe
"GET /groups/:path/projects"
do
subject
{
projects_group_path
(
group
)
}
it
{
is_expected
.
to
be_allowed_for
owner
}
it
{
is_expected
.
to
be_denied_for
master
}
it
{
is_expected
.
to
be_denied_for
reporter
}
it
{
is_expected
.
to
be_allowed_for
:admin
}
it
{
is_expected
.
to
be_denied_for
guest
}
it
{
is_expected
.
to
be_denied_for
:user
}
it
{
is_expected
.
to
be_denied_for
:visitor
}
end
end
end
spec/features/security/group/internal_group_access_spec.rb
deleted
100644 → 0
View file @
0d5cf111
require
'spec_helper'
describe
"Group with internal project access"
,
feature:
true
do
include
AccessMatchers
describe
"Group"
do
let
(
:group
)
{
create
(
:group
)
}
let
(
:owner
)
{
create
(
:owner
)
}
let
(
:master
)
{
create
(
:user
)
}
let
(
:reporter
)
{
create
(
:user
)
}
let
(
:guest
)
{
create
(
:user
)
}
let
(
:nonmember
)
{
create
(
:user
)
}
before
do
group
.
add_user
(
owner
,
Gitlab
::
Access
::
OWNER
)
group
.
add_user
(
master
,
Gitlab
::
Access
::
MASTER
)
group
.
add_user
(
reporter
,
Gitlab
::
Access
::
REPORTER
)
group
.
add_user
(
guest
,
Gitlab
::
Access
::
GUEST
)
create
(
:project
,
:internal
,
group:
group
)
end
describe
"GET /groups/:path"
do
subject
{
group_path
(
group
)
}
it
{
is_expected
.
to
be_allowed_for
owner
}
it
{
is_expected
.
to
be_allowed_for
master
}
it
{
is_expected
.
to
be_allowed_for
reporter
}
it
{
is_expected
.
to
be_allowed_for
:admin
}
it
{
is_expected
.
to
be_allowed_for
guest
}
it
{
is_expected
.
to
be_allowed_for
:user
}
it
{
is_expected
.
to
be_denied_for
:visitor
}
end
describe
"GET /groups/:path/issues"
do
subject
{
issues_group_path
(
group
)
}
it
{
is_expected
.
to
be_allowed_for
owner
}
it
{
is_expected
.
to
be_allowed_for
master
}
it
{
is_expected
.
to
be_allowed_for
reporter
}
it
{
is_expected
.
to
be_allowed_for
:admin
}
it
{
is_expected
.
to
be_allowed_for
guest
}
it
{
is_expected
.
to
be_allowed_for
:user
}
it
{
is_expected
.
to
be_denied_for
:visitor
}
end
describe
"GET /groups/:path/merge_requests"
do
subject
{
merge_requests_group_path
(
group
)
}
it
{
is_expected
.
to
be_allowed_for
owner
}
it
{
is_expected
.
to
be_allowed_for
master
}
it
{
is_expected
.
to
be_allowed_for
reporter
}
it
{
is_expected
.
to
be_allowed_for
:admin
}
it
{
is_expected
.
to
be_allowed_for
guest
}
it
{
is_expected
.
to
be_allowed_for
:user
}
it
{
is_expected
.
to
be_denied_for
:visitor
}
end
describe
"GET /groups/:path/group_members"
do
subject
{
group_group_members_path
(
group
)
}
it
{
is_expected
.
to
be_allowed_for
owner
}
it
{
is_expected
.
to
be_allowed_for
master
}
it
{
is_expected
.
to
be_allowed_for
reporter
}
it
{
is_expected
.
to
be_allowed_for
:admin
}
it
{
is_expected
.
to
be_allowed_for
guest
}
it
{
is_expected
.
to
be_allowed_for
:user
}
it
{
is_expected
.
to
be_denied_for
:visitor
}
end
describe
"GET /groups/:path/edit"
do
subject
{
edit_group_path
(
group
)
}
it
{
is_expected
.
to
be_allowed_for
owner
}
it
{
is_expected
.
to
be_denied_for
master
}
it
{
is_expected
.
to
be_denied_for
reporter
}
it
{
is_expected
.
to
be_allowed_for
:admin
}
it
{
is_expected
.
to
be_denied_for
guest
}
it
{
is_expected
.
to
be_denied_for
:user
}
it
{
is_expected
.
to
be_denied_for
:visitor
}
end
end
end
spec/features/security/group/mixed_group_access_spec.rb
deleted
100644 → 0
View file @
0d5cf111
require
'spec_helper'
describe
"Group access"
,
feature:
true
do
include
AccessMatchers
describe
"Group"
do
let
(
:group
)
{
create
(
:group
)
}
let
(
:owner
)
{
create
(
:owner
)
}
let
(
:master
)
{
create
(
:user
)
}
let
(
:reporter
)
{
create
(
:user
)
}
let
(
:guest
)
{
create
(
:user
)
}
let
(
:nonmember
)
{
create
(
:user
)
}
before
do
group
.
add_user
(
owner
,
Gitlab
::
Access
::
OWNER
)
group
.
add_user
(
master
,
Gitlab
::
Access
::
MASTER
)
group
.
add_user
(
reporter
,
Gitlab
::
Access
::
REPORTER
)
group
.
add_user
(
guest
,
Gitlab
::
Access
::
GUEST
)
create
(
:project
,
:internal
,
path:
"internal_project"
,
group:
group
)
create
(
:project
,
:public
,
path:
"public_project"
,
group:
group
)
end
describe
"GET /groups/:path"
do
subject
{
group_path
(
group
)
}
it
{
is_expected
.
to
be_allowed_for
owner
}
it
{
is_expected
.
to
be_allowed_for
master
}
it
{
is_expected
.
to
be_allowed_for
reporter
}
it
{
is_expected
.
to
be_allowed_for
:admin
}
it
{
is_expected
.
to
be_allowed_for
guest
}
it
{
is_expected
.
to
be_allowed_for
:user
}
it
{
is_expected
.
to
be_allowed_for
:visitor
}
end
describe
"GET /groups/:path/issues"
do
subject
{
issues_group_path
(
group
)
}
it
{
is_expected
.
to
be_allowed_for
owner
}
it
{
is_expected
.
to
be_allowed_for
master
}
it
{
is_expected
.
to
be_allowed_for
reporter
}
it
{
is_expected
.
to
be_allowed_for
:admin
}
it
{
is_expected
.
to
be_allowed_for
guest
}
it
{
is_expected
.
to
be_allowed_for
:user
}
it
{
is_expected
.
to
be_allowed_for
:visitor
}
end
describe
"GET /groups/:path/merge_requests"
do
subject
{
merge_requests_group_path
(
group
)
}
it
{
is_expected
.
to
be_allowed_for
owner
}
it
{
is_expected
.
to
be_allowed_for
master
}
it
{
is_expected
.
to
be_allowed_for
reporter
}
it
{
is_expected
.
to
be_allowed_for
:admin
}
it
{
is_expected
.
to
be_allowed_for
guest
}
it
{
is_expected
.
to
be_allowed_for
:user
}
it
{
is_expected
.
to
be_allowed_for
:visitor
}
end
describe
"GET /groups/:path/group_members"
do
subject
{
group_group_members_path
(
group
)
}
it
{
is_expected
.
to
be_allowed_for
owner
}
it
{
is_expected
.
to
be_allowed_for
master
}
it
{
is_expected
.
to
be_allowed_for
reporter
}
it
{
is_expected
.
to
be_allowed_for
:admin
}
it
{
is_expected
.
to
be_allowed_for
guest
}
it
{
is_expected
.
to
be_allowed_for
:user
}
it
{
is_expected
.
to
be_allowed_for
:visitor
}
end
describe
"GET /groups/:path/edit"
do
subject
{
edit_group_path
(
group
)
}
it
{
is_expected
.
to
be_allowed_for
owner
}
it
{
is_expected
.
to
be_denied_for
master
}
it
{
is_expected
.
to
be_denied_for
reporter
}
it
{
is_expected
.
to
be_allowed_for
:admin
}
it
{
is_expected
.
to
be_denied_for
guest
}
it
{
is_expected
.
to
be_denied_for
:user
}
it
{
is_expected
.
to
be_denied_for
:visitor
}
end
end
end
spec/features/security/group/public_group_access_spec.rb
deleted
100644 → 0
View file @
0d5cf111
require
'spec_helper'
describe
"Group with public project access"
,
feature:
true
do
include
AccessMatchers
describe
"Group"
do
let
(
:group
)
{
create
(
:group
)
}
let
(
:owner
)
{
create
(
:owner
)
}
let
(
:master
)
{
create
(
:user
)
}
let
(
:reporter
)
{
create
(
:user
)
}
let
(
:guest
)
{
create
(
:user
)
}
let
(
:nonmember
)
{
create
(
:user
)
}
before
do
group
.
add_user
(
owner
,
Gitlab
::
Access
::
OWNER
)
group
.
add_user
(
master
,
Gitlab
::
Access
::
MASTER
)
group
.
add_user
(
reporter
,
Gitlab
::
Access
::
REPORTER
)
group
.
add_user
(
guest
,
Gitlab
::
Access
::
GUEST
)
create
(
:project
,
:public
,
group:
group
)
end
describe
"GET /groups/:path"
do
subject
{
group_path
(
group
)
}
it
{
is_expected
.
to
be_allowed_for
owner
}
it
{
is_expected
.
to
be_allowed_for
master
}
it
{
is_expected
.
to
be_allowed_for
reporter
}
it
{
is_expected
.
to
be_allowed_for
:admin
}
it
{
is_expected
.
to
be_allowed_for
guest
}
it
{
is_expected
.
to
be_allowed_for
:user
}
it
{
is_expected
.
to
be_allowed_for
:visitor
}
end
describe
"GET /groups/:path/issues"
do
subject
{
issues_group_path
(
group
)
}
it
{
is_expected
.
to
be_allowed_for
owner
}
it
{
is_expected
.
to
be_allowed_for
master
}
it
{
is_expected
.
to
be_allowed_for
reporter
}
it
{
is_expected
.
to
be_allowed_for
:admin
}
it
{
is_expected
.
to
be_allowed_for
guest
}
it
{
is_expected
.
to
be_allowed_for
:user
}
it
{
is_expected
.
to
be_allowed_for
:visitor
}
end
describe
"GET /groups/:path/merge_requests"
do
subject
{
merge_requests_group_path
(
group
)
}
it
{
is_expected
.
to
be_allowed_for
owner
}
it
{
is_expected
.
to
be_allowed_for
master
}
it
{
is_expected
.
to
be_allowed_for
reporter
}
it
{
is_expected
.
to
be_allowed_for
:admin
}
it
{
is_expected
.
to
be_allowed_for
guest
}
it
{
is_expected
.
to
be_allowed_for
:user
}
it
{
is_expected
.
to
be_allowed_for
:visitor
}
end
describe
"GET /groups/:path/group_members"
do
subject
{
group_group_members_path
(
group
)
}
it
{
is_expected
.
to
be_allowed_for
owner
}
it
{
is_expected
.
to
be_allowed_for
master
}
it
{
is_expected
.
to
be_allowed_for
reporter
}
it
{
is_expected
.
to
be_allowed_for
:admin
}
it
{
is_expected
.
to
be_allowed_for
guest
}
it
{
is_expected
.
to
be_allowed_for
:user
}
it
{
is_expected
.
to
be_allowed_for
:visitor
}
end
describe
"GET /groups/:path/edit"
do
subject
{
edit_group_path
(
group
)
}
it
{
is_expected
.
to
be_allowed_for
owner
}
it
{
is_expected
.
to
be_denied_for
master
}
it
{
is_expected
.
to
be_denied_for
reporter
}
it
{
is_expected
.
to
be_allowed_for
:admin
}
it
{
is_expected
.
to
be_denied_for
guest
}
it
{
is_expected
.
to
be_denied_for
:user
}
it
{
is_expected
.
to
be_denied_for
:visitor
}
end
end
end
spec/features/security/group_access_spec.rb
0 → 100644
View file @
b24d5f13
This diff is collapsed.
Click to expand it.
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