Skip to content

Commit

Permalink
ability to delete a project
Browse files Browse the repository at this point in the history
close #32
  • Loading branch information
NARKOZ committed May 21, 2014
1 parent 6135248 commit 68aebb7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/gitlab/client/projects.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@ def create_project(name, options={})
post(url, :body => {:name => name}.merge(options))
end

# Deletes a project.
#
# @example
# Gitlab.delete_project(4)
#
# @param [Integer, String] id The ID or name of a project.
# @return [Gitlab::ObjectifiedHash] Information about deleted project.
def delete_project(id)
delete("/projects/#{id}")
end

# Gets a list of project team members.
#
# @example
Expand Down
16 changes: 16 additions & 0 deletions spec/gitlab/client/projects_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,22 @@
end
end

describe ".delete_project" do
before do
stub_delete("/projects/Gitlab", "project")
@project = Gitlab.delete_project('Gitlab')
end

it "should get the correct resource" do
expect(a_delete("/projects/Gitlab")).to have_been_made
end

it "should return information about a created project" do
expect(@project.name).to eq("Gitlab")
expect(@project.owner.name).to eq("John Smith")
end
end

describe ".team_members" do
before do
stub_get("/projects/3/members", "team_members")
Expand Down

0 comments on commit 68aebb7

Please sign in to comment.