Merge pull request #2946 from Asquera/fix/access_to_non_existent_branch

API: Fixes return code when accessing non existent branch (#2922)
This commit is contained in:
Dmitriy Zaporozhets 2013-02-12 09:24:54 -08:00
commit 8f9c01feed
3 changed files with 9 additions and 0 deletions

View file

@ -109,6 +109,11 @@ describe Gitlab::API do
json_response['commit']['id'].should == '621491c677087aa243f165eab467bfdfbee00be1'
json_response['protected'].should == false
end
it "should return a 404 error if branch is not available" do
get api("/projects/#{project.id}/repository/branches/unknown", user)
response.status.should == 404
end
end
describe "PUT /projects/:id/repository/branches/:branch/protect" do