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
7a33aaf0
Commit
7a33aaf0
authored
Jan 27, 2017
by
Toon Claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use VisibilityLevel constants in spec
parent
c6ad83ec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+4
-4
No files found.
spec/requests/api/projects_spec.rb
View file @
7a33aaf0
...
@@ -822,7 +822,7 @@ describe API::Projects, api: true do
...
@@ -822,7 +822,7 @@ describe API::Projects, api: true do
it
'creates a new project snippet'
do
it
'creates a new project snippet'
do
post
api
(
"/projects/
#{
project
.
id
}
/snippets"
,
user
),
post
api
(
"/projects/
#{
project
.
id
}
/snippets"
,
user
),
title:
'api test'
,
file_name:
'sample.rb'
,
code:
'test'
,
title:
'api test'
,
file_name:
'sample.rb'
,
code:
'test'
,
visibility_level:
'0'
visibility_level:
Gitlab
::
VisibilityLevel
::
PRIVATE
expect
(
response
).
to
have_http_status
(
201
)
expect
(
response
).
to
have_http_status
(
201
)
expect
(
json_response
[
'title'
]).
to
eq
(
'api test'
)
expect
(
json_response
[
'title'
]).
to
eq
(
'api test'
)
end
end
...
@@ -1071,7 +1071,7 @@ describe API::Projects, api: true do
...
@@ -1071,7 +1071,7 @@ describe API::Projects, api: true do
end
end
it
'updates visibility_level'
do
it
'updates visibility_level'
do
project_param
=
{
visibility_level:
20
}
project_param
=
{
visibility_level:
Gitlab
::
VisibilityLevel
::
PUBLIC
}
put
api
(
"/projects/
#{
project3
.
id
}
"
,
user
),
project_param
put
api
(
"/projects/
#{
project3
.
id
}
"
,
user
),
project_param
expect
(
response
).
to
have_http_status
(
200
)
expect
(
response
).
to
have_http_status
(
200
)
project_param
.
each_pair
do
|
k
,
v
|
project_param
.
each_pair
do
|
k
,
v
|
...
@@ -1081,7 +1081,7 @@ describe API::Projects, api: true do
...
@@ -1081,7 +1081,7 @@ describe API::Projects, api: true do
it
'updates visibility_level from public to private'
do
it
'updates visibility_level from public to private'
do
project3
.
update_attributes
({
visibility_level:
Gitlab
::
VisibilityLevel
::
PUBLIC
})
project3
.
update_attributes
({
visibility_level:
Gitlab
::
VisibilityLevel
::
PUBLIC
})
project_param
=
{
visibility_level:
0
}
project_param
=
{
visibility_level:
Gitlab
::
VisibilityLevel
::
PRIVATE
}
put
api
(
"/projects/
#{
project3
.
id
}
"
,
user
),
project_param
put
api
(
"/projects/
#{
project3
.
id
}
"
,
user
),
project_param
expect
(
response
).
to
have_http_status
(
200
)
expect
(
response
).
to
have_http_status
(
200
)
project_param
.
each_pair
do
|
k
,
v
|
project_param
.
each_pair
do
|
k
,
v
|
...
@@ -1154,7 +1154,7 @@ describe API::Projects, api: true do
...
@@ -1154,7 +1154,7 @@ describe API::Projects, api: true do
end
end
it
'does not update visibility_level'
do
it
'does not update visibility_level'
do
project_param
=
{
visibility_level:
20
}
project_param
=
{
visibility_level:
Gitlab
::
VisibilityLevel
::
PUBLIC
}
put
api
(
"/projects/
#{
project3
.
id
}
"
,
user4
),
project_param
put
api
(
"/projects/
#{
project3
.
id
}
"
,
user4
),
project_param
expect
(
response
).
to
have_http_status
(
403
)
expect
(
response
).
to
have_http_status
(
403
)
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