API: return status code 400 if filepath of raw file blob not given
This commit is contained in:
parent
fd01f3aacd
commit
54ab9bb6df
2 changed files with 8 additions and 1 deletions
|
@ -468,7 +468,7 @@ describe Gitlab::API do
|
|||
end
|
||||
end
|
||||
|
||||
describe "GET /projects/:id/:sha/blob" do
|
||||
describe "GET /projects/:id/repository/commits/:sha/blob" do
|
||||
it "should get the raw file contents" do
|
||||
get api("/projects/#{project.id}/repository/commits/master/blob?filepath=README.md", user)
|
||||
response.status.should == 200
|
||||
|
@ -483,5 +483,10 @@ describe Gitlab::API do
|
|||
get api("/projects/#{project.id}/repository/commits/master/blob?filepath=README.invalid", user)
|
||||
response.status.should == 404
|
||||
end
|
||||
|
||||
it "should return a 400 error if filepath is missing" do
|
||||
get api("/projects/#{project.id}/repository/commits/master/blob", user)
|
||||
response.status.should == 400
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue