Project creation API has some issues
Created by: dipeshba
I have been trying to create a project using API. But the parameters doesn't seems to work as documented.
I have to provide 'code' and 'path' in case 'name' contains white spaces. Other wise i get 404.
Second 'wall_enabled' and 'wiki_enabled' when set to false, it still doesn't change the default state of true.
Here is the extract from Rails console:
1.9.3p327 :001 > result = HTTParty.post("http://192.168.2.4/api/v2/projects?private_token=N4heGk2cxZVVSRPpiMEh",
1.9.3p327 :002 > :body => { :name => "Test Project",
1.9.3p327 :003 > :code => "test_project",
1.9.3p327 :004 > :path => "test_project",
1.9.3p327 :005 > :wall_enabled => false,
1.9.3p327 :006 > :merge_requests_enabled => false,
1.9.3p327 :007 > :wiki_enabled => false
1.9.3p327 :008?> }.to_json,
1.9.3p327 :009 > :headers => { 'Content-Type' => 'application/json' } )
=> #<HTTParty::Response:0x7fdcd2482fb8 parsed_response={"id"=>8, "code"=>"test_project", "name"=>"Test Project", "description"=>nil, "path"=>"test_project", "default_branch"=>nil, "owner"=>{"id"=>3, "email"=>"[email protected]", "name"=>"Dipesh Batheja", "blocked"=>false, "created_at"=>"2012-11-22T18:15:06Z"}, "private"=>true, "issues_enabled"=>true, "merge_requests_enabled"=>true, "wall_enabled"=>true, "wiki_enabled"=>true, "created_at"=>"2012-11-30T09:25:33Z"}, @response=#<Net::HTTPCreated 201 Created readbody=true>, @headers={"server"=>["nginx/1.1.19"], "date"=>["Fri, 30 Nov 2012 09:25:50 GMT"], "content-type"=>["application/json"], "content-length"=>["383"], "connection"=>["close"], "status"=>["201 Created"], "x-ua-compatible"=>["IE=Edge,chrome=1"], "etag"=>["\"a124dbb7f8f4787af88c5c1cddef9fec\""], "cache-control"=>["max-age=0, private, must-revalidate"], "x-request-id"=>["545611bfefcc922233dde0505a50d6d2"], "x-runtime"=>["16.418208"], "x-rack-cache"=>["invalidate, pass"]}>