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
Tatuya Kamada
gitlab-ce
Commits
9c560b5c
Commit
9c560b5c
authored
Jan 17, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace many :project with :empty_projects in API specs
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
78d71038
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
53 additions
and
54 deletions
+53
-54
spec/requests/api/access_requests_spec.rb
spec/requests/api/access_requests_spec.rb
+1
-1
spec/requests/api/boards_spec.rb
spec/requests/api/boards_spec.rb
+2
-2
spec/requests/api/deploy_keys_spec.rb
spec/requests/api/deploy_keys_spec.rb
+2
-2
spec/requests/api/environments_spec.rb
spec/requests/api/environments_spec.rb
+1
-1
spec/requests/api/fork_spec.rb
spec/requests/api/fork_spec.rb
+1
-1
spec/requests/api/groups_spec.rb
spec/requests/api/groups_spec.rb
+8
-8
spec/requests/api/internal_spec.rb
spec/requests/api/internal_spec.rb
+2
-2
spec/requests/api/issues_spec.rb
spec/requests/api/issues_spec.rb
+5
-5
spec/requests/api/labels_spec.rb
spec/requests/api/labels_spec.rb
+1
-1
spec/requests/api/members_spec.rb
spec/requests/api/members_spec.rb
+1
-1
spec/requests/api/merge_requests_spec.rb
spec/requests/api/merge_requests_spec.rb
+2
-2
spec/requests/api/notes_spec.rb
spec/requests/api/notes_spec.rb
+4
-4
spec/requests/api/notification_settings_spec.rb
spec/requests/api/notification_settings_spec.rb
+1
-1
spec/requests/api/project_hooks_spec.rb
spec/requests/api/project_hooks_spec.rb
+2
-2
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+14
-15
spec/requests/api/runners_spec.rb
spec/requests/api/runners_spec.rb
+2
-2
spec/requests/api/todos_spec.rb
spec/requests/api/todos_spec.rb
+2
-2
spec/requests/api/triggers_spec.rb
spec/requests/api/triggers_spec.rb
+1
-1
spec/requests/api/variables_spec.rb
spec/requests/api/variables_spec.rb
+1
-1
No files found.
spec/requests/api/access_requests_spec.rb
View file @
9c560b5c
...
...
@@ -9,7 +9,7 @@ describe API::AccessRequests, api: true do
let
(
:stranger
)
{
create
(
:user
)
}
let
(
:project
)
do
create
(
:project
,
:public
,
:access_requestable
,
creator_id:
master
.
id
,
namespace:
master
.
namespace
)
do
|
project
|
create
(
:
empty_
project
,
:public
,
:access_requestable
,
creator_id:
master
.
id
,
namespace:
master
.
namespace
)
do
|
project
|
project
.
team
<<
[
developer
,
:developer
]
project
.
team
<<
[
master
,
:master
]
project
.
request_access
(
access_requester
)
...
...
spec/requests/api/boards_spec.rb
View file @
9c560b5c
...
...
@@ -8,7 +8,7 @@ describe API::Boards, api: true do
let
(
:non_member
)
{
create
(
:user
)
}
let
(
:guest
)
{
create
(
:user
)
}
let
(
:admin
)
{
create
(
:user
,
:admin
)
}
let!
(
:project
)
{
create
(
:project
,
:public
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
}
let!
(
:project
)
{
create
(
:
empty_
project
,
:public
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
}
let!
(
:dev_label
)
do
create
(
:label
,
title:
'Development'
,
color:
'#FFAABB'
,
project:
project
)
...
...
@@ -188,7 +188,7 @@ describe API::Boards, api: true do
context
"when the user is project owner"
do
let
(
:owner
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
namespace:
owner
.
namespace
)
}
let
(
:project
)
{
create
(
:
empty_
project
,
namespace:
owner
.
namespace
)
}
it
"deletes the list if an admin requests it"
do
delete
api
(
"
#{
base_url
}
/
#{
dev_list
.
id
}
"
,
owner
)
...
...
spec/requests/api/deploy_keys_spec.rb
View file @
9c560b5c
...
...
@@ -5,8 +5,8 @@ describe API::DeployKeys, api: true do
let
(
:user
)
{
create
(
:user
)
}
let
(
:admin
)
{
create
(
:admin
)
}
let
(
:project
)
{
create
(
:project
,
creator_id:
user
.
id
)
}
let
(
:project2
)
{
create
(
:project
,
creator_id:
user
.
id
)
}
let
(
:project
)
{
create
(
:
empty_
project
,
creator_id:
user
.
id
)
}
let
(
:project2
)
{
create
(
:
empty_
project
,
creator_id:
user
.
id
)
}
let
(
:deploy_key
)
{
create
(
:deploy_key
,
public:
true
)
}
let!
(
:deploy_keys_project
)
do
...
...
spec/requests/api/environments_spec.rb
View file @
9c560b5c
...
...
@@ -5,7 +5,7 @@ describe API::Environments, api: true do
let
(
:user
)
{
create
(
:user
)
}
let
(
:non_member
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
:private
,
namespace:
user
.
namespace
)
}
let
(
:project
)
{
create
(
:
empty_
project
,
:private
,
namespace:
user
.
namespace
)
}
let!
(
:environment
)
{
create
(
:environment
,
project:
project
)
}
before
do
...
...
spec/requests/api/fork_spec.rb
View file @
9c560b5c
require
'spec_helper'
describe
API
::
API
,
api:
true
do
describe
API
::
Projects
,
api:
true
do
include
ApiHelpers
let
(
:user
)
{
create
(
:user
)
}
let
(
:user2
)
{
create
(
:user
)
}
...
...
spec/requests/api/groups_spec.rb
View file @
9c560b5c
...
...
@@ -10,9 +10,9 @@ describe API::Groups, api: true do
let
(
:admin
)
{
create
(
:admin
)
}
let!
(
:group1
)
{
create
(
:group
,
avatar:
File
.
open
(
uploaded_image_temp_path
))
}
let!
(
:group2
)
{
create
(
:group
,
:private
)
}
let!
(
:project1
)
{
create
(
:project
,
namespace:
group1
)
}
let!
(
:project2
)
{
create
(
:project
,
namespace:
group2
)
}
let!
(
:project3
)
{
create
(
:project
,
namespace:
group1
,
path:
'test'
,
visibility_level:
Gitlab
::
VisibilityLevel
::
PRIVATE
)
}
let!
(
:project1
)
{
create
(
:
empty_
project
,
namespace:
group1
)
}
let!
(
:project2
)
{
create
(
:
empty_
project
,
namespace:
group2
)
}
let!
(
:project3
)
{
create
(
:
empty_
project
,
namespace:
group1
,
path:
'test'
,
visibility_level:
Gitlab
::
VisibilityLevel
::
PRIVATE
)
}
before
do
group1
.
add_owner
(
user1
)
...
...
@@ -163,7 +163,7 @@ describe API::Groups, api: true do
describe
"GET /groups/:id"
do
context
"when authenticated as user"
do
it
"returns one of user1's groups"
do
project
=
create
(
:project
,
namespace:
group2
,
path:
'Foo'
)
project
=
create
(
:
empty_
project
,
namespace:
group2
,
path:
'Foo'
)
create
(
:project_group_link
,
project:
project
,
group:
group1
)
get
api
(
"/groups/
#{
group1
.
id
}
"
,
user1
)
...
...
@@ -287,7 +287,7 @@ describe API::Groups, api: true do
expect
(
json_response
.
length
).
to
eq
(
2
)
project_names
=
json_response
.
map
{
|
proj
|
proj
[
'name'
]
}
expect
(
project_names
).
to
match_array
([
project1
.
name
,
project3
.
name
])
expect
(
json_response
.
first
[
'
default_branch
'
]).
to
be_present
expect
(
json_response
.
first
[
'
visibility_level
'
]).
to
be_present
end
it
"returns the group's projects with simple representation"
do
...
...
@@ -297,11 +297,11 @@ describe API::Groups, api: true do
expect
(
json_response
.
length
).
to
eq
(
2
)
project_names
=
json_response
.
map
{
|
proj
|
proj
[
'name'
]
}
expect
(
project_names
).
to
match_array
([
project1
.
name
,
project3
.
name
])
expect
(
json_response
.
first
[
'
default_branch
'
]).
not_to
be_present
expect
(
json_response
.
first
[
'
visibility_level
'
]).
not_to
be_present
end
it
'filters the groups projects'
do
public_project
=
create
(
:project
,
:public
,
path:
'test1'
,
group:
group1
)
public_project
=
create
(
:
empty_
project
,
:public
,
path:
'test1'
,
group:
group1
)
get
api
(
"/groups/
#{
group1
.
id
}
/projects"
,
user1
),
visibility:
'public'
...
...
@@ -462,7 +462,7 @@ describe API::Groups, api: true do
end
describe
"POST /groups/:id/projects/:project_id"
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:
empty_
project
)
}
let
(
:project_path
)
{
"
#{
project
.
namespace
.
path
}
%2F
#{
project
.
path
}
"
}
before
(
:each
)
do
...
...
spec/requests/api/internal_spec.rb
View file @
9c560b5c
...
...
@@ -239,7 +239,7 @@ describe API::Internal, api: true do
end
context
"blocked user"
do
let
(
:personal_project
)
{
create
(
:project
,
namespace:
user
.
namespace
)
}
let
(
:personal_project
)
{
create
(
:
empty_
project
,
namespace:
user
.
namespace
)
}
before
do
user
.
block
...
...
@@ -265,7 +265,7 @@ describe API::Internal, api: true do
end
context
"archived project"
do
let
(
:personal_project
)
{
create
(
:project
,
namespace:
user
.
namespace
)
}
let
(
:personal_project
)
{
create
(
:
empty_
project
,
namespace:
user
.
namespace
)
}
before
do
project
.
team
<<
[
user
,
:developer
]
...
...
spec/requests/api/issues_spec.rb
View file @
9c560b5c
...
...
@@ -11,7 +11,7 @@ describe API::Issues, api: true do
let
(
:author
)
{
create
(
:author
)
}
let
(
:assignee
)
{
create
(
:assignee
)
}
let
(
:admin
)
{
create
(
:user
,
:admin
)
}
let!
(
:project
)
{
create
(
:project
,
:public
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
}
let!
(
:project
)
{
create
(
:
empty_
project
,
:public
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
}
let!
(
:closed_issue
)
do
create
:closed_issue
,
author:
user
,
...
...
@@ -224,7 +224,7 @@ describe API::Issues, api: true do
describe
"GET /groups/:id/issues"
do
let!
(
:group
)
{
create
(
:group
)
}
let!
(
:group_project
)
{
create
(
:project
,
:public
,
creator_id:
user
.
id
,
namespace:
group
)
}
let!
(
:group_project
)
{
create
(
:
empty_
project
,
:public
,
creator_id:
user
.
id
,
namespace:
group
)
}
let!
(
:group_closed_issue
)
do
create
:closed_issue
,
author:
user
,
...
...
@@ -1052,7 +1052,7 @@ describe API::Issues, api: true do
context
"when the user is project owner"
do
let
(
:owner
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
namespace:
owner
.
namespace
)
}
let
(
:project
)
{
create
(
:
empty_
project
,
namespace:
owner
.
namespace
)
}
it
"deletes the issue if an admin requests it"
do
delete
api
(
"/projects/
#{
project
.
id
}
/issues/
#{
issue
.
id
}
"
,
owner
)
...
...
@@ -1071,8 +1071,8 @@ describe API::Issues, api: true do
end
describe
'/projects/:id/issues/:issue_id/move'
do
let!
(
:target_project
)
{
create
(
:project
,
path:
'project2'
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
}
let!
(
:target_project2
)
{
create
(
:project
,
creator_id:
non_member
.
id
,
namespace:
non_member
.
namespace
)
}
let!
(
:target_project
)
{
create
(
:
empty_
project
,
path:
'project2'
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
}
let!
(
:target_project2
)
{
create
(
:
empty_
project
,
creator_id:
non_member
.
id
,
namespace:
non_member
.
namespace
)
}
it
'moves an issue'
do
post
api
(
"/projects/
#{
project
.
id
}
/issues/
#{
issue
.
id
}
/move"
,
user
),
...
...
spec/requests/api/labels_spec.rb
View file @
9c560b5c
...
...
@@ -4,7 +4,7 @@ describe API::Labels, api: true do
include
ApiHelpers
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
}
let
(
:project
)
{
create
(
:
empty_
project
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
}
let!
(
:label1
)
{
create
(
:label
,
title:
'label1'
,
project:
project
)
}
let!
(
:priority_label
)
{
create
(
:label
,
title:
'bug'
,
project:
project
,
priority:
3
)
}
...
...
spec/requests/api/members_spec.rb
View file @
9c560b5c
...
...
@@ -9,7 +9,7 @@ describe API::Members, api: true do
let
(
:stranger
)
{
create
(
:user
)
}
let
(
:project
)
do
create
(
:project
,
:public
,
:access_requestable
,
creator_id:
master
.
id
,
namespace:
master
.
namespace
)
do
|
project
|
create
(
:
empty_
project
,
:public
,
:access_requestable
,
creator_id:
master
.
id
,
namespace:
master
.
namespace
)
do
|
project
|
project
.
team
<<
[
developer
,
:developer
]
project
.
team
<<
[
master
,
:master
]
project
.
request_access
(
access_requester
)
...
...
spec/requests/api/merge_requests_spec.rb
View file @
9c560b5c
...
...
@@ -308,8 +308,8 @@ describe API::MergeRequests, api: true do
context
'forked projects'
do
let!
(
:user2
)
{
create
(
:user
)
}
let!
(
:fork_project
)
{
create
(
:project
,
forked_from_project:
project
,
namespace:
user2
.
namespace
,
creator_id:
user2
.
id
)
}
let!
(
:unrelated_project
)
{
create
(
:project
,
namespace:
create
(
:user
).
namespace
,
creator_id:
user2
.
id
)
}
let!
(
:fork_project
)
{
create
(
:
empty_
project
,
forked_from_project:
project
,
namespace:
user2
.
namespace
,
creator_id:
user2
.
id
)
}
let!
(
:unrelated_project
)
{
create
(
:
empty_
project
,
namespace:
create
(
:user
).
namespace
,
creator_id:
user2
.
id
)
}
before
:each
do
|
each
|
fork_project
.
team
<<
[
user2
,
:reporter
]
...
...
spec/requests/api/notes_spec.rb
View file @
9c560b5c
...
...
@@ -3,7 +3,7 @@ require 'spec_helper'
describe
API
::
Notes
,
api:
true
do
include
ApiHelpers
let
(
:user
)
{
create
(
:user
)
}
let!
(
:project
)
{
create
(
:project
,
:public
,
namespace:
user
.
namespace
)
}
let!
(
:project
)
{
create
(
:
empty_
project
,
:public
,
namespace:
user
.
namespace
)
}
let!
(
:issue
)
{
create
(
:issue
,
project:
project
,
author:
user
)
}
let!
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
,
target_project:
project
,
author:
user
)
}
let!
(
:snippet
)
{
create
(
:project_snippet
,
project:
project
,
author:
user
)
}
...
...
@@ -14,12 +14,12 @@ describe API::Notes, api: true do
# For testing the cross-reference of a private issue in a public issue
let
(
:private_user
)
{
create
(
:user
)
}
let
(
:private_project
)
do
create
(
:project
,
namespace:
private_user
.
namespace
).
create
(
:
empty_
project
,
namespace:
private_user
.
namespace
).
tap
{
|
p
|
p
.
team
<<
[
private_user
,
:master
]
}
end
let
(
:private_issue
)
{
create
(
:issue
,
project:
private_project
)
}
let
(
:ext_proj
)
{
create
(
:project
,
:public
)
}
let
(
:ext_proj
)
{
create
(
:
empty_
project
,
:public
)
}
let
(
:ext_issue
)
{
create
(
:issue
,
project:
ext_proj
)
}
let!
(
:cross_reference_note
)
do
...
...
@@ -265,7 +265,7 @@ describe API::Notes, api: true do
end
context
'when user does not have access to create noteable'
do
let
(
:private_issue
)
{
create
(
:issue
,
project:
create
(
:project
,
:private
))
}
let
(
:private_issue
)
{
create
(
:issue
,
project:
create
(
:
empty_
project
,
:private
))
}
##
# We are posting to project user has access to, but we use issue id
...
...
spec/requests/api/notification_settings_spec.rb
View file @
9c560b5c
...
...
@@ -5,7 +5,7 @@ describe API::NotificationSettings, api: true do
let
(
:user
)
{
create
(
:user
)
}
let!
(
:group
)
{
create
(
:group
)
}
let!
(
:project
)
{
create
(
:project
,
:public
,
creator_id:
user
.
id
,
namespace:
group
)
}
let!
(
:project
)
{
create
(
:
empty_
project
,
:public
,
creator_id:
user
.
id
,
namespace:
group
)
}
describe
"GET /notification_settings"
do
it
"returns global notification settings for the current user"
do
...
...
spec/requests/api/project_hooks_spec.rb
View file @
9c560b5c
...
...
@@ -4,7 +4,7 @@ describe API::ProjectHooks, 'ProjectHooks', api: true do
include
ApiHelpers
let
(
:user
)
{
create
(
:user
)
}
let
(
:user3
)
{
create
(
:user
)
}
let!
(
:project
)
{
create
(
:project
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
}
let!
(
:project
)
{
create
(
:
empty_
project
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
}
let!
(
:hook
)
do
create
(
:project_hook
,
:all_events_enabled
,
...
...
@@ -204,7 +204,7 @@ describe API::ProjectHooks, 'ProjectHooks', api: true do
it
"returns a 404 if a user attempts to delete project hooks he/she does not own"
do
test_user
=
create
(
:user
)
other_project
=
create
(
:project
)
other_project
=
create
(
:
empty_
project
)
other_project
.
team
<<
[
test_user
,
:master
]
delete
api
(
"/projects/
#{
other_project
.
id
}
/hooks/
#{
hook
.
id
}
"
,
test_user
)
...
...
spec/requests/api/projects_spec.rb
View file @
9c560b5c
...
...
@@ -8,8 +8,8 @@ describe API::Projects, api: true do
let
(
:user2
)
{
create
(
:user
)
}
let
(
:user3
)
{
create
(
:user
)
}
let
(
:admin
)
{
create
(
:admin
)
}
let
(
:project
)
{
create
(
:project
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
}
let
(
:project2
)
{
create
(
:project
,
path:
'project2'
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
}
let
(
:project
)
{
create
(
:
empty_
project
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
}
let
(
:project2
)
{
create
(
:
empty_
project
,
path:
'project2'
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
}
let
(
:snippet
)
{
create
(
:project_snippet
,
:public
,
author:
user
,
project:
project
,
title:
'example'
)
}
let
(
:project_member
)
{
create
(
:project_member
,
:master
,
user:
user
,
project:
project
)
}
let
(
:project_member2
)
{
create
(
:project_member
,
:developer
,
user:
user3
,
project:
project
)
}
...
...
@@ -32,7 +32,7 @@ describe API::Projects, api: true do
access_level:
ProjectMember
::
MASTER
)
end
let
(
:project4
)
do
create
(
:project
,
create
(
:
empty_
project
,
name:
'third_project'
,
path:
'third_project'
,
creator_id:
user4
.
id
,
...
...
@@ -252,7 +252,7 @@ describe API::Projects, api: true do
end
end
let!
(
:public_project
)
{
create
(
:project
,
:public
)
}
let!
(
:public_project
)
{
create
(
:
empty_
project
,
:public
)
}
before
do
project
project2
...
...
@@ -283,7 +283,7 @@ describe API::Projects, api: true do
end
describe
'GET /projects/starred'
do
let
(
:public_project
)
{
create
(
:project
,
:public
)
}
let
(
:public_project
)
{
create
(
:
empty_
project
,
:public
)
}
before
do
project_member2
...
...
@@ -583,7 +583,7 @@ describe API::Projects, api: true do
describe
'GET /projects/:id'
do
context
'when unauthenticated'
do
it
'returns the public projects'
do
public_project
=
create
(
:project
,
:public
)
public_project
=
create
(
:
empty_
project
,
:public
)
get
api
(
"/projects/
#{
public_project
.
id
}
"
)
...
...
@@ -665,7 +665,7 @@ describe API::Projects, api: true do
it
'handles users with dots'
do
dot_user
=
create
(
:user
,
username:
'dot.user'
)
project
=
create
(
:project
,
creator_id:
dot_user
.
id
,
namespace:
dot_user
.
namespace
)
project
=
create
(
:
empty_
project
,
creator_id:
dot_user
.
id
,
namespace:
dot_user
.
namespace
)
get
api
(
"/projects/
#{
dot_user
.
namespace
.
name
}
%2F
#{
project
.
path
}
"
,
dot_user
)
expect
(
response
).
to
have_http_status
(
200
)
...
...
@@ -711,7 +711,7 @@ describe API::Projects, api: true do
end
context
'group project'
do
let
(
:project2
)
{
create
(
:project
,
group:
create
(
:group
))
}
let
(
:project2
)
{
create
(
:
empty_
project
,
group:
create
(
:group
))
}
before
{
project2
.
group
.
add_owner
(
user
)
}
...
...
@@ -756,7 +756,7 @@ describe API::Projects, api: true do
context
'when unauthenticated'
do
it_behaves_like
'project events response'
do
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:project
)
{
create
(
:
empty_
project
,
:public
)
}
let
(
:current_user
)
{
nil
}
end
end
...
...
@@ -807,7 +807,7 @@ describe API::Projects, api: true do
context
'when unauthenticated'
do
it_behaves_like
'project users response'
do
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:project
)
{
create
(
:
empty_
project
,
:public
)
}
let
(
:current_user
)
{
nil
}
end
end
...
...
@@ -921,11 +921,11 @@ describe API::Projects, api: true do
end
describe
:fork_admin
do
let
(
:project_fork_target
)
{
create
(
:project
)
}
let
(
:project_fork_source
)
{
create
(
:project
,
:public
)
}
let
(
:project_fork_target
)
{
create
(
:
empty_
project
)
}
let
(
:project_fork_source
)
{
create
(
:
empty_
project
,
:public
)
}
describe
'POST /projects/:id/fork/:forked_from_id'
do
let
(
:new_project_fork_source
)
{
create
(
:project
,
:public
)
}
let
(
:new_project_fork_source
)
{
create
(
:
empty_
project
,
:public
)
}
it
"is not available for non admin users"
do
post
api
(
"/projects/
#{
project_fork_target
.
id
}
/fork/
#{
project_fork_source
.
id
}
"
,
user
)
...
...
@@ -966,7 +966,7 @@ describe API::Projects, api: true do
end
context
'when users belong to project group'
do
let
(
:project_fork_target
)
{
create
(
:project
,
group:
create
(
:group
))
}
let
(
:project_fork_target
)
{
create
(
:
empty_
project
,
group:
create
(
:group
))
}
before
do
project_fork_target
.
group
.
add_owner
user
...
...
@@ -1121,7 +1121,6 @@ describe API::Projects, api: true do
it_behaves_like
'project search response'
,
query:
'one.dot.two'
,
results:
1
do
let
(
:current_user
)
{
user
}
end
end
context
'when authenticated as a different user'
do
...
...
spec/requests/api/runners_spec.rb
View file @
9c560b5c
...
...
@@ -7,8 +7,8 @@ describe API::Runners, api: true do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user2
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
creator_id:
user
.
id
)
}
let
(
:project2
)
{
create
(
:project
,
creator_id:
user
.
id
)
}
let
(
:project
)
{
create
(
:
empty_
project
,
creator_id:
user
.
id
)
}
let
(
:project2
)
{
create
(
:
empty_
project
,
creator_id:
user
.
id
)
}
let!
(
:shared_runner
)
{
create
(
:ci_runner
,
:shared
)
}
let!
(
:unused_specific_runner
)
{
create
(
:ci_runner
)
}
...
...
spec/requests/api/todos_spec.rb
View file @
9c560b5c
...
...
@@ -3,8 +3,8 @@ require 'spec_helper'
describe
API
::
Todos
,
api:
true
do
include
ApiHelpers
let
(
:project_1
)
{
create
(
:project
)
}
let
(
:project_2
)
{
create
(
:project
)
}
let
(
:project_1
)
{
create
(
:
empty_
project
)
}
let
(
:project_2
)
{
create
(
:
empty_
project
)
}
let
(
:author_1
)
{
create
(
:user
)
}
let
(
:author_2
)
{
create
(
:user
)
}
let
(
:john_doe
)
{
create
(
:user
,
username:
'john_doe'
)
}
...
...
spec/requests/api/triggers_spec.rb
View file @
9c560b5c
...
...
@@ -15,7 +15,7 @@ describe API::Triggers do
let!
(
:trigger_request
)
{
create
(
:ci_trigger_request
,
trigger:
trigger
,
created_at:
'2015-01-01 12:13:14'
)
}
describe
'POST /projects/:project_id/trigger'
do
let!
(
:project2
)
{
create
(
:
empty_
project
)
}
let!
(
:project2
)
{
create
(
:project
)
}
let
(
:options
)
do
{
token:
trigger_token
...
...
spec/requests/api/variables_spec.rb
View file @
9c560b5c
...
...
@@ -5,7 +5,7 @@ describe API::Variables, api: true do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user2
)
{
create
(
:user
)
}
let!
(
:project
)
{
create
(
:project
,
creator_id:
user
.
id
)
}
let!
(
:project
)
{
create
(
:
empty_
project
,
creator_id:
user
.
id
)
}
let!
(
:master
)
{
create
(
:project_member
,
:master
,
user:
user
,
project:
project
)
}
let!
(
:developer
)
{
create
(
:project_member
,
:developer
,
user:
user2
,
project:
project
)
}
let!
(
:variable
)
{
create
(
:ci_variable
,
project:
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