diff options
author | Angus MacArthur <amacarthur@rim.com> | 2012-11-15 00:37:52 +0400 |
---|---|---|
committer | Angus MacArthur <amacarthur@blackberry.com> | 2013-03-05 19:38:43 +0400 |
commit | 61ffcab60fef2efcd54b8496aa09de79ee999a2c (patch) | |
tree | 7a493e25800421cdb94607b52836d50274d5c0f7 /spec/requests/api/groups_spec.rb | |
parent | d5663e148fdf8d1c767479e62c86c7a2b4db654e (diff) |
Additional Admin APIs
Diffstat (limited to 'spec/requests/api/groups_spec.rb')
-rw-r--r-- | spec/requests/api/groups_spec.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/requests/api/groups_spec.rb b/spec/requests/api/groups_spec.rb index c39a4228408..63616eef1bb 100644 --- a/spec/requests/api/groups_spec.rb +++ b/spec/requests/api/groups_spec.rb @@ -90,4 +90,27 @@ describe Gitlab::API do end end end + + describe "POST /groups/:id/projects/:project_id" do + let(:project) { create(:project) } + before(:each) do + project.stub!(:transfer).and_return(true) + Project.stub(:find).and_return(project) + end + + + context "when authenticated as user" do + it "should not transfer project to group" do + post api("/groups/#{group1.id}/projects/#{project.id}", user2) + response.status.should == 403 + end + end + + context "when authenticated as admin" do + it "should transfer project to group" do + project.should_receive(:transfer) + post api("/groups/#{group1.id}/projects/#{project.id}", admin) + end + end + end end |