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
0b825802
Commit
0b825802
authored
Feb 02, 2021
by
Mikolaj Wawrzyniak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove hardcoded values from projets api test
parent
081562d2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+7
-7
No files found.
spec/requests/api/projects_spec.rb
View file @
0b825802
...
...
@@ -1139,7 +1139,7 @@ RSpec.describe API::Projects do
let!
(
:public_project
)
{
create
(
:project
,
:public
,
name:
'public_project'
,
creator_id:
user4
.
id
,
namespace:
user4
.
namespace
)
}
it
'returns error when user not found'
do
get
api
(
'/users/0/projects/'
)
get
api
(
"/users/
#{
non_existing_record_id
}
/projects/"
)
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
expect
(
json_response
[
'message'
]).
to
eq
(
'404 User Not Found'
)
...
...
@@ -2154,7 +2154,7 @@ RSpec.describe API::Projects do
end
it
'fails if forked_from project which does not exist'
do
post
api
(
"/projects/
#{
project_fork_target
.
id
}
/fork/
0
"
,
admin
)
post
api
(
"/projects/
#{
project_fork_target
.
id
}
/fork/
#{
non_existing_record_id
}
"
,
admin
)
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
...
...
@@ -2398,7 +2398,7 @@ RSpec.describe API::Projects do
end
it
'returns a 404 error when project does not exist'
do
delete
api
(
"/projects/
123
/share/
#{
non_existing_record_id
}
"
,
user
)
delete
api
(
"/projects/
#{
non_existing_record_id
}
/share/
#{
non_existing_record_id
}
"
,
user
)
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
...
...
@@ -2955,7 +2955,7 @@ RSpec.describe API::Projects do
end
it
'returns the proper security headers'
do
get
api
(
'/projects/1/starrers'
,
current_user
)
get
api
(
"/projects/
#{
public_project
.
id
}
/starrers"
,
current_user
)
expect
(
response
).
to
include_security_headers
end
...
...
@@ -3028,7 +3028,7 @@ RSpec.describe API::Projects do
end
it
'returns not_found(404) for not existing project'
do
get
api
(
"/projects/
0
/languages"
,
user
)
get
api
(
"/projects/
#{
non_existing_record_id
}
/languages"
,
user
)
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
...
...
@@ -3079,7 +3079,7 @@ RSpec.describe API::Projects do
end
it
'does not remove a non existing project'
do
delete
api
(
'/projects/1328'
,
user
)
delete
api
(
"/projects/
#{
non_existing_record_id
}
"
,
user
)
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
...
...
@@ -3098,7 +3098,7 @@ RSpec.describe API::Projects do
end
it
'does not remove a non existing project'
do
delete
api
(
'/projects/1328'
,
admin
)
delete
api
(
"/projects/
#{
non_existing_record_id
}
"
,
admin
)
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
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