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:
authorMatt Humphrey <matt@tomatto.co.uk>2013-01-28 21:22:44 +0400
committerMatt Humphrey <matt@tomatto.co.uk>2013-01-31 13:26:03 +0400
commit2c7554e897356fe424f292c66cd03e0192b05167 (patch)
tree486591bc4278aecd394eb85494cf734405ba2921 /spec
parentdf6db81e2ab36410c377f8a9a712756653de0e2a (diff)
Added methods to protect and unprotect branches
Diffstat (limited to 'spec')
-rw-r--r--spec/requests/api/projects_spec.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb
index c2244210bcf..d932fd9e74d 100644
--- a/spec/requests/api/projects_spec.rb
+++ b/spec/requests/api/projects_spec.rb
@@ -107,6 +107,29 @@ describe Gitlab::API do
json_response['name'].should == 'new_design'
json_response['commit']['id'].should == '621491c677087aa243f165eab467bfdfbee00be1'
+ json_response['protected'].should == false
+ end
+ end
+
+ describe "PUT /projects/:id/repository/branches/:branch/protect" do
+ it "should protect a single branch" do
+ put api("/projects/#{project.id}/repository/branches/new_design/protect", user)
+ response.status.should == 200
+
+ json_response['name'].should == 'new_design'
+ json_response['commit']['id'].should == '621491c677087aa243f165eab467bfdfbee00be1'
+ json_response['protected'].should == true
+ end
+ end
+
+ describe "PUT /projects/:id/repository/branches/:branch/unprotect" do
+ it "should unprotect a single branch" do
+ put api("/projects/#{project.id}/repository/branches/new_design/unprotect", user)
+ response.status.should == 200
+
+ json_response['name'].should == 'new_design'
+ json_response['commit']['id'].should == '621491c677087aa243f165eab467bfdfbee00be1'
+ json_response['protected'].should == false
end
end