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
Boxiang Sun
gitlab-ce
Commits
de944c91
Commit
de944c91
authored
Mar 06, 2016
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add traits for each access_level to ProjectMember factory
parent
042b047f
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
50 additions
and
30 deletions
+50
-30
features/steps/project/merge_requests/acceptance.rb
features/steps/project/merge_requests/acceptance.rb
+1
-1
features/steps/project/merge_requests/revert.rb
features/steps/project/merge_requests/revert.rb
+1
-1
spec/factories/project_members.rb
spec/factories/project_members.rb
+21
-1
spec/requests/api/branches_spec.rb
spec/requests/api/branches_spec.rb
+2
-2
spec/requests/api/builds_spec.rb
spec/requests/api/builds_spec.rb
+2
-2
spec/requests/api/commit_status_spec.rb
spec/requests/api/commit_status_spec.rb
+5
-5
spec/requests/api/commits_spec.rb
spec/requests/api/commits_spec.rb
+2
-2
spec/requests/api/fork_spec.rb
spec/requests/api/fork_spec.rb
+1
-1
spec/requests/api/project_members_spec.rb
spec/requests/api/project_members_spec.rb
+2
-2
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+2
-2
spec/requests/api/repositories_spec.rb
spec/requests/api/repositories_spec.rb
+2
-2
spec/requests/api/runners_spec.rb
spec/requests/api/runners_spec.rb
+3
-3
spec/requests/api/tags_spec.rb
spec/requests/api/tags_spec.rb
+2
-2
spec/requests/api/triggers_spec.rb
spec/requests/api/triggers_spec.rb
+2
-2
spec/requests/api/variables_spec.rb
spec/requests/api/variables_spec.rb
+2
-2
No files found.
features/steps/project/merge_requests/acceptance.rb
View file @
de944c91
...
@@ -29,7 +29,7 @@ class Spinach::Features::ProjectMergeRequestsAcceptance < Spinach::FeatureSteps
...
@@ -29,7 +29,7 @@ class Spinach::Features::ProjectMergeRequestsAcceptance < Spinach::FeatureSteps
step
'There is an open Merge Request'
do
step
'There is an open Merge Request'
do
@user
=
create
(
:user
)
@user
=
create
(
:user
)
@project
=
create
(
:project
,
:public
)
@project
=
create
(
:project
,
:public
)
@project_member
=
create
(
:project_member
,
user:
@user
,
project:
@project
,
access_level:
ProjectMember
::
DEVELOPER
)
@project_member
=
create
(
:project_member
,
:developer
,
user:
@user
,
project:
@project
)
@merge_request
=
create
(
:merge_request
,
:with_diffs
,
:simple
,
source_project:
@project
)
@merge_request
=
create
(
:merge_request
,
:with_diffs
,
:simple
,
source_project:
@project
)
end
end
...
...
features/steps/project/merge_requests/revert.rb
View file @
de944c91
...
@@ -36,7 +36,7 @@ class Spinach::Features::RevertMergeRequests < Spinach::FeatureSteps
...
@@ -36,7 +36,7 @@ class Spinach::Features::RevertMergeRequests < Spinach::FeatureSteps
step
'There is an open Merge Request'
do
step
'There is an open Merge Request'
do
@user
=
create
(
:user
)
@user
=
create
(
:user
)
@project
=
create
(
:project
,
:public
)
@project
=
create
(
:project
,
:public
)
@project_member
=
create
(
:project_member
,
user:
@user
,
project:
@project
,
access_level:
ProjectMember
::
DEVELOPER
)
@project_member
=
create
(
:project_member
,
:developer
,
user:
@user
,
project:
@project
)
@merge_request
=
create
(
:merge_request
,
:with_diffs
,
:simple
,
source_project:
@project
)
@merge_request
=
create
(
:merge_request
,
:with_diffs
,
:simple
,
source_project:
@project
)
end
end
...
...
spec/factories/project_members.rb
View file @
de944c91
...
@@ -2,6 +2,26 @@ FactoryGirl.define do
...
@@ -2,6 +2,26 @@ FactoryGirl.define do
factory
:project_member
do
factory
:project_member
do
user
user
project
project
access_level
{
ProjectMember
::
MASTER
}
master
trait
:guest
do
access_level
ProjectMember
::
GUEST
end
trait
:reporter
do
access_level
ProjectMember
::
REPORTER
end
trait
:developer
do
access_level
ProjectMember
::
DEVELOPER
end
trait
:master
do
access_level
ProjectMember
::
MASTER
end
trait
:owner
do
access_level
ProjectMember
::
OWNER
end
end
end
end
end
spec/requests/api/branches_spec.rb
View file @
de944c91
...
@@ -7,8 +7,8 @@ describe API::API, api: true do
...
@@ -7,8 +7,8 @@ describe API::API, api: true do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:user2
)
{
create
(
:user
)
}
let
(
:user2
)
{
create
(
:user
)
}
let!
(
:project
)
{
create
(
:project
,
creator_id:
user
.
id
)
}
let!
(
:project
)
{
create
(
:project
,
creator_id:
user
.
id
)
}
let!
(
:master
)
{
create
(
:project_member
,
user:
user
,
project:
project
,
access_level:
ProjectMember
::
MASTER
)
}
let!
(
:master
)
{
create
(
:project_member
,
:master
,
user:
user
,
project:
project
)
}
let!
(
:guest
)
{
create
(
:project_member
,
user:
user2
,
project:
project
,
access_level:
ProjectMember
::
GUEST
)
}
let!
(
:guest
)
{
create
(
:project_member
,
:guest
,
user:
user2
,
project:
project
)
}
let!
(
:branch_name
)
{
'feature'
}
let!
(
:branch_name
)
{
'feature'
}
let!
(
:branch_sha
)
{
'0b4bc9a49b562e85de7cc9e834518ea6828729b9'
}
let!
(
:branch_sha
)
{
'0b4bc9a49b562e85de7cc9e834518ea6828729b9'
}
...
...
spec/requests/api/builds_spec.rb
View file @
de944c91
...
@@ -7,8 +7,8 @@ describe API::API, api: true do
...
@@ -7,8 +7,8 @@ describe API::API, api: true do
let
(
:api_user
)
{
user
}
let
(
:api_user
)
{
user
}
let
(
:user2
)
{
create
(
:user
)
}
let
(
:user2
)
{
create
(
:user
)
}
let!
(
:project
)
{
create
(
:project
,
creator_id:
user
.
id
)
}
let!
(
:project
)
{
create
(
:project
,
creator_id:
user
.
id
)
}
let!
(
:developer
)
{
create
(
:project_member
,
user:
user
,
project:
project
,
access_level:
ProjectMember
::
DEVELOPER
)
}
let!
(
:developer
)
{
create
(
:project_member
,
:developer
,
user:
user
,
project:
project
)
}
let!
(
:reporter
)
{
create
(
:project_member
,
user:
user2
,
project:
project
,
access_level:
ProjectMember
::
REPORTER
)
}
let!
(
:reporter
)
{
create
(
:project_member
,
:reporter
,
user:
user2
,
project:
project
)
}
let
(
:commit
)
{
create
(
:ci_commit
,
project:
project
)}
let
(
:commit
)
{
create
(
:ci_commit
,
project:
project
)}
let
(
:build
)
{
create
(
:ci_build
,
commit:
commit
)
}
let
(
:build
)
{
create
(
:ci_build
,
commit:
commit
)
}
...
...
spec/requests/api/commit_status_spec.rb
View file @
de944c91
...
@@ -6,9 +6,9 @@ describe API::CommitStatus, api: true do
...
@@ -6,9 +6,9 @@ describe API::CommitStatus, api: true do
let!
(
:project
)
{
create
(
:project
)
}
let!
(
:project
)
{
create
(
:project
)
}
let
(
:commit
)
{
project
.
repository
.
commit
}
let
(
:commit
)
{
project
.
repository
.
commit
}
let
(
:commit_status
)
{
create
(
:commit_status
,
commit:
ci_commit
)
}
let
(
:commit_status
)
{
create
(
:commit_status
,
commit:
ci_commit
)
}
let
(
:guest
)
{
create_user
(
ProjectMember
::
GUEST
)
}
let
(
:guest
)
{
create_user
(
:guest
)
}
let
(
:reporter
)
{
create_user
(
ProjectMember
::
REPORTER
)
}
let
(
:reporter
)
{
create_user
(
:reporter
)
}
let
(
:developer
)
{
create_user
(
ProjectMember
::
DEVELOPER
)
}
let
(
:developer
)
{
create_user
(
:developer
)
}
let
(
:sha
)
{
commit
.
id
}
let
(
:sha
)
{
commit
.
id
}
...
@@ -201,9 +201,9 @@ describe API::CommitStatus, api: true do
...
@@ -201,9 +201,9 @@ describe API::CommitStatus, api: true do
end
end
end
end
def
create_user
(
access_level
)
def
create_user
(
access_level
_trait
)
user
=
create
(
:user
)
user
=
create
(
:user
)
create
(
:project_member
,
user:
user
,
project:
project
,
access_level:
access_level
)
create
(
:project_member
,
access_level_trait
,
user:
user
,
project:
project
)
user
user
end
end
end
end
spec/requests/api/commits_spec.rb
View file @
de944c91
...
@@ -6,8 +6,8 @@ describe API::API, api: true do
...
@@ -6,8 +6,8 @@ describe API::API, api: true do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:user2
)
{
create
(
:user
)
}
let
(
:user2
)
{
create
(
:user
)
}
let!
(
:project
)
{
create
(
:project
,
creator_id:
user
.
id
)
}
let!
(
:project
)
{
create
(
:project
,
creator_id:
user
.
id
)
}
let!
(
:master
)
{
create
(
:project_member
,
user:
user
,
project:
project
,
access_level:
ProjectMember
::
MASTER
)
}
let!
(
:master
)
{
create
(
:project_member
,
:master
,
user:
user
,
project:
project
)
}
let!
(
:guest
)
{
create
(
:project_member
,
user:
user2
,
project:
project
,
access_level:
ProjectMember
::
GUEST
)
}
let!
(
:guest
)
{
create
(
:project_member
,
:guest
,
user:
user2
,
project:
project
)
}
let!
(
:note
)
{
create
(
:note_on_commit
,
author:
user
,
project:
project
,
commit_id:
project
.
repository
.
commit
.
id
,
note:
'a comment on a commit'
)
}
let!
(
:note
)
{
create
(
:note_on_commit
,
author:
user
,
project:
project
,
commit_id:
project
.
repository
.
commit
.
id
,
note:
'a comment on a commit'
)
}
let!
(
:another_note
)
{
create
(
:note_on_commit
,
author:
user
,
project:
project
,
commit_id:
project
.
repository
.
commit
.
id
,
note:
'another comment on a commit'
)
}
let!
(
:another_note
)
{
create
(
:note_on_commit
,
author:
user
,
project:
project
,
commit_id:
project
.
repository
.
commit
.
id
,
note:
'another comment on a commit'
)
}
...
...
spec/requests/api/fork_spec.rb
View file @
de944c91
...
@@ -12,7 +12,7 @@ describe API::API, api: true do
...
@@ -12,7 +12,7 @@ describe API::API, api: true do
end
end
let
(
:project_user2
)
do
let
(
:project_user2
)
do
create
(
:project_member
,
user:
user2
,
project:
project
,
access_level:
ProjectMember
::
GUEST
)
create
(
:project_member
,
:guest
,
user:
user2
,
project:
project
)
end
end
describe
'POST /projects/fork/:id'
do
describe
'POST /projects/fork/:id'
do
...
...
spec/requests/api/project_members_spec.rb
View file @
de944c91
...
@@ -6,8 +6,8 @@ describe API::API, api: true do
...
@@ -6,8 +6,8 @@ describe API::API, api: true do
let
(
:user2
)
{
create
(
:user
)
}
let
(
:user2
)
{
create
(
:user
)
}
let
(
:user3
)
{
create
(
:user
)
}
let
(
:user3
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
}
let
(
:project
)
{
create
(
:project
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
}
let
(
:project_member
)
{
create
(
:project_member
,
user:
user
,
project:
project
,
access_level:
ProjectMember
::
MASTER
)
}
let
(
:project_member
)
{
create
(
:project_member
,
:master
,
user:
user
,
project:
project
)
}
let
(
:project_member2
)
{
create
(
:project_member
,
user:
user3
,
project:
project
,
access_level:
ProjectMember
::
DEVELOPER
)
}
let
(
:project_member2
)
{
create
(
:project_member
,
:developer
,
user:
user3
,
project:
project
)
}
describe
"GET /projects/:id/members"
do
describe
"GET /projects/:id/members"
do
before
{
project_member
}
before
{
project_member
}
...
...
spec/requests/api/projects_spec.rb
View file @
de944c91
...
@@ -12,8 +12,8 @@ describe API::API, api: true do
...
@@ -12,8 +12,8 @@ describe API::API, api: true do
let
(
:project2
)
{
create
(
:project
,
path:
'project2'
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
}
let
(
:project2
)
{
create
(
:project
,
path:
'project2'
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
}
let
(
:project3
)
{
create
(
:project
,
path:
'project3'
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
}
let
(
:project3
)
{
create
(
:project
,
path:
'project3'
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
}
let
(
:snippet
)
{
create
(
:project_snippet
,
author:
user
,
project:
project
,
title:
'example'
)
}
let
(
:snippet
)
{
create
(
:project_snippet
,
author:
user
,
project:
project
,
title:
'example'
)
}
let
(
:project_member
)
{
create
(
:project_member
,
user:
user
,
project:
project
,
access_level:
ProjectMember
::
MASTER
)
}
let
(
:project_member
)
{
create
(
:project_member
,
:master
,
user:
user
,
project:
project
)
}
let
(
:project_member2
)
{
create
(
:project_member
,
user:
user3
,
project:
project
,
access_level:
ProjectMember
::
DEVELOPER
)
}
let
(
:project_member2
)
{
create
(
:project_member
,
:developer
,
user:
user3
,
project:
project
)
}
let
(
:user4
)
{
create
(
:user
)
}
let
(
:user4
)
{
create
(
:user
)
}
let
(
:project3
)
do
let
(
:project3
)
do
create
(
:project
,
create
(
:project
,
...
...
spec/requests/api/repositories_spec.rb
View file @
de944c91
...
@@ -9,8 +9,8 @@ describe API::API, api: true do
...
@@ -9,8 +9,8 @@ describe API::API, api: true do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:user2
)
{
create
(
:user
)
}
let
(
:user2
)
{
create
(
:user
)
}
let!
(
:project
)
{
create
(
:project
,
creator_id:
user
.
id
)
}
let!
(
:project
)
{
create
(
:project
,
creator_id:
user
.
id
)
}
let!
(
:master
)
{
create
(
:project_member
,
user:
user
,
project:
project
,
access_level:
ProjectMember
::
MASTER
)
}
let!
(
:master
)
{
create
(
:project_member
,
:master
,
user:
user
,
project:
project
)
}
let!
(
:guest
)
{
create
(
:project_member
,
user:
user2
,
project:
project
,
access_level:
ProjectMember
::
GUEST
)
}
let!
(
:guest
)
{
create
(
:project_member
,
:guest
,
user:
user2
,
project:
project
)
}
describe
"GET /projects/:id/repository/tree"
do
describe
"GET /projects/:id/repository/tree"
do
context
"authorized user"
do
context
"authorized user"
do
...
...
spec/requests/api/runners_spec.rb
View file @
de944c91
...
@@ -28,9 +28,9 @@ describe API::Runners, api: true do
...
@@ -28,9 +28,9 @@ describe API::Runners, api: true do
before
do
before
do
# Set project access for users
# Set project access for users
create
(
:project_member
,
user:
user
,
project:
project
,
access_level:
ProjectMember
::
MASTER
)
create
(
:project_member
,
:master
,
user:
user
,
project:
project
)
create
(
:project_member
,
user:
user
,
project:
project2
,
access_level:
ProjectMember
::
MASTER
)
create
(
:project_member
,
:master
,
user:
user
,
project:
project2
)
create
(
:project_member
,
user:
user2
,
project:
project
,
access_level:
ProjectMember
::
REPORTER
)
create
(
:project_member
,
:reporter
,
user:
user2
,
project:
project
)
end
end
describe
'GET /runners'
do
describe
'GET /runners'
do
...
...
spec/requests/api/tags_spec.rb
View file @
de944c91
...
@@ -8,8 +8,8 @@ describe API::API, api: true do
...
@@ -8,8 +8,8 @@ describe API::API, api: true do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:user2
)
{
create
(
:user
)
}
let
(
:user2
)
{
create
(
:user
)
}
let!
(
:project
)
{
create
(
:project
,
creator_id:
user
.
id
)
}
let!
(
:project
)
{
create
(
:project
,
creator_id:
user
.
id
)
}
let!
(
:master
)
{
create
(
:project_member
,
user:
user
,
project:
project
,
access_level:
ProjectMember
::
MASTER
)
}
let!
(
:master
)
{
create
(
:project_member
,
:master
,
user:
user
,
project:
project
)
}
let!
(
:guest
)
{
create
(
:project_member
,
user:
user2
,
project:
project
,
access_level:
ProjectMember
::
GUEST
)
}
let!
(
:guest
)
{
create
(
:project_member
,
:guest
,
user:
user2
,
project:
project
)
}
describe
"GET /projects/:id/repository/tags"
do
describe
"GET /projects/:id/repository/tags"
do
let
(
:tag_name
)
{
project
.
repository
.
tag_names
.
sort
.
reverse
.
first
}
let
(
:tag_name
)
{
project
.
repository
.
tag_names
.
sort
.
reverse
.
first
}
...
...
spec/requests/api/triggers_spec.rb
View file @
de944c91
...
@@ -8,8 +8,8 @@ describe API::API do
...
@@ -8,8 +8,8 @@ describe API::API do
let!
(
:trigger_token
)
{
'secure_token'
}
let!
(
:trigger_token
)
{
'secure_token'
}
let!
(
:trigger_token_2
)
{
'secure_token_2'
}
let!
(
:trigger_token_2
)
{
'secure_token_2'
}
let!
(
:project
)
{
create
(
:project
,
creator_id:
user
.
id
)
}
let!
(
:project
)
{
create
(
:project
,
creator_id:
user
.
id
)
}
let!
(
:master
)
{
create
(
:project_member
,
user:
user
,
project:
project
,
access_level:
ProjectMember
::
MASTER
)
}
let!
(
:master
)
{
create
(
:project_member
,
:master
,
user:
user
,
project:
project
)
}
let!
(
:developer
)
{
create
(
:project_member
,
user:
user2
,
project:
project
,
access_level:
ProjectMember
::
DEVELOPER
)
}
let!
(
:developer
)
{
create
(
:project_member
,
:developer
,
user:
user2
,
project:
project
)
}
let!
(
:trigger
)
{
create
(
:ci_trigger
,
project:
project
,
token:
trigger_token
)
}
let!
(
:trigger
)
{
create
(
:ci_trigger
,
project:
project
,
token:
trigger_token
)
}
let!
(
:trigger2
)
{
create
(
:ci_trigger
,
project:
project
,
token:
trigger_token_2
)
}
let!
(
:trigger2
)
{
create
(
:ci_trigger
,
project:
project
,
token:
trigger_token_2
)
}
let!
(
:trigger_request
)
{
create
(
:ci_trigger_request
,
trigger:
trigger
,
created_at:
'2015-01-01 12:13:14'
)
}
let!
(
:trigger_request
)
{
create
(
:ci_trigger_request
,
trigger:
trigger
,
created_at:
'2015-01-01 12:13:14'
)
}
...
...
spec/requests/api/variables_spec.rb
View file @
de944c91
...
@@ -6,8 +6,8 @@ describe API::API, api: true do
...
@@ -6,8 +6,8 @@ describe API::API, api: true do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:user2
)
{
create
(
:user
)
}
let
(
:user2
)
{
create
(
:user
)
}
let!
(
:project
)
{
create
(
:project
,
creator_id:
user
.
id
)
}
let!
(
:project
)
{
create
(
:project
,
creator_id:
user
.
id
)
}
let!
(
:master
)
{
create
(
:project_member
,
user:
user
,
project:
project
,
access_level:
ProjectMember
::
MASTER
)
}
let!
(
:master
)
{
create
(
:project_member
,
:master
,
user:
user
,
project:
project
)
}
let!
(
:developer
)
{
create
(
:project_member
,
user:
user2
,
project:
project
,
access_level:
ProjectMember
::
DEVELOPER
)
}
let!
(
:developer
)
{
create
(
:project_member
,
:developer
,
user:
user2
,
project:
project
)
}
let!
(
:variable
)
{
create
(
:ci_variable
,
project:
project
)
}
let!
(
:variable
)
{
create
(
:ci_variable
,
project:
project
)
}
describe
'GET /projects/:id/variables'
do
describe
'GET /projects/:id/variables'
do
...
...
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