Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorSebastian Ziebell <sebastian.ziebell@asquera.de>2013-02-08 20:04:08 +0400
committerSebastian Ziebell <sebastian.ziebell@asquera.de>2013-02-08 20:04:08 +0400
commit40e7846f3e25b7f679c9dda719c135fca1ef3d5b (patch)
tree6ff1748dc1a545eee2c1f1e45dd0d27e629ebe46 /spec
parent2f0a75ab77af430f682d67aa9bb865007d832795 (diff)
Status code 404 returned when retrieving non existent branch (issue #2922)
Accessing a repository branch that does not exist returns a 404 error instead of 200 now. Added a test.
Diffstat (limited to 'spec')
-rw-r--r--spec/requests/api/projects_spec.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb
index d932fd9e74d..16fd1b9307c 100644
--- a/spec/requests/api/projects_spec.rb
+++ b/spec/requests/api/projects_spec.rb
@@ -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