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
a185cce5
Commit
a185cce5
authored
Nov 19, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tests for delete file by API
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
32d7332d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
spec/requests/api/files_spec.rb
spec/requests/api/files_spec.rb
+34
-0
No files found.
spec/requests/api/files_spec.rb
View file @
a185cce5
...
...
@@ -78,4 +78,38 @@ describe API::API do
response
.
status
.
should
==
400
end
end
describe
"DELETE /projects/:id/repository/files"
do
let
(
:valid_params
)
{
{
file_path:
'spec/spec_helper.rb'
,
branch_name:
'master'
,
commit_message:
'Changed file'
}
}
it
"should delete existing file in project repo"
do
Gitlab
::
Satellite
::
DeleteFileAction
.
any_instance
.
stub
(
commit!:
true
,
)
delete
api
(
"/projects/
#{
project
.
id
}
/repository/files"
,
user
),
valid_params
response
.
status
.
should
==
200
json_response
[
'file_path'
].
should
==
'spec/spec_helper.rb'
end
it
"should return a 400 bad request if no params given"
do
delete
api
(
"/projects/
#{
project
.
id
}
/repository/files"
,
user
)
response
.
status
.
should
==
400
end
it
"should return a 400 if satellite fails to create file"
do
Gitlab
::
Satellite
::
DeleteFileAction
.
any_instance
.
stub
(
commit!:
false
,
)
delete
api
(
"/projects/
#{
project
.
id
}
/repository/files"
,
user
),
valid_params
response
.
status
.
should
==
400
end
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