summaryrefslogtreecommitdiff
path: root/spec/requests
diff options
context:
space:
mode:
authorAngus MacArthur <amacarthur@blackberry.com>2013-07-12 11:58:17 -0400
committerAngus MacArthur <amacarthur@blackberry.com>2013-07-12 12:10:42 -0400
commitace5c54ab91cdb9142a27d4543ee839684d29d5d (patch)
tree83fd323808932c7ad8a070dad6a7953ad1079fc4 /spec/requests
parentacb402a1c1cfb23613be0f988b60884c352de37c (diff)
downloadgitlab-ce-ace5c54ab91cdb9142a27d4543ee839684d29d5d.tar.gz
enhance project creation apis to allow setting of public attribute
Change-Id: Ib71ce8cf993627eada63d7d596fb302ec702f36e
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/projects_spec.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb
index 300bff28871..863ecc61bbb 100644
--- a/spec/requests/api/projects_spec.rb
+++ b/spec/requests/api/projects_spec.rb
@@ -104,6 +104,21 @@ describe API::API do
json_response[k.to_s].should == v
end
end
+
+ it "should set a project as public" do
+ project = attributes_for(:project, { public: true })
+ post api("/projects", user), project
+ json_response['public'].should be_true
+
+ end
+
+ it "should set a project as private" do
+ project = attributes_for(:project, { public: false })
+ post api("/projects", user), project
+ json_response['public'].should be_false
+
+ end
+
end
describe "POST /projects/user/:id" do
@@ -144,6 +159,21 @@ describe API::API do
json_response[k.to_s].should == v
end
end
+
+ it "should set a project as public" do
+ project = attributes_for(:project, { public: true })
+ post api("/projects/user/#{user.id}", admin), project
+ json_response['public'].should be_true
+
+ end
+
+ it "should set a project as private" do
+ project = attributes_for(:project, { public: false })
+ post api("/projects/user/#{user.id}", admin), project
+ json_response['public'].should be_false
+
+ end
+
end
describe "GET /projects/:id" do