diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-31 10:44:20 -0800 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-31 10:44:20 -0800 |
commit | 5857a7a9ce6f9bd37b633d48074778bcbde880a4 (patch) | |
tree | 10bc126e3da80bbd4133a51e36636186655101cf /spec | |
parent | dfe2a742c2f2b862109a757cf90495ea1fcde70c (diff) | |
parent | 2c7554e897356fe424f292c66cd03e0192b05167 (diff) | |
download | gitlab-ce-5857a7a9ce6f9bd37b633d48074778bcbde880a4.tar.gz |
Merge pull request #2839 from m4tthumphrey/protected-branches-api
Added methods to protect and unprotect branches in from the API
Diffstat (limited to 'spec')
-rw-r--r-- | spec/requests/api/projects_spec.rb | 23 |
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 |